Login Signout using Ajax

Login & Signout using Ajax

AjaxLogin

Authenticates a user using username and password provided in the query string. Authentication cookie is set as a result.

Parameters

username Username to check.
password Password to check.

Returns

JSON string with the following values:

Status int

Status code.

  • 200 = OK
  • 204 = Username and password doesn't match
  • 500 = Fails
Message string Status clarification.

Example Request

7929888_547x379

AjaxSignOut

Sign out current user - resets an authentication cookie and releases user-related data from the server.

RETURNS

JSON string with the following values:

Status int

Status code.

  • 200 = OK
  • 500 = Fails
Message string Status clarification.

Configuration

In order to enable AjaxLogin to all users you need to add the following part into your web.config file:

web.config

    <location path="AjaxLogin">
        <system.web>
            <authorization>
                <allow users="*" />
            </authorization>
        </system.web>
    </location>