POST /oauth/login

Allows a person to log in for the purposes of OAuth, and returns the OAuth authentication cookie. For users signed up on the platform; other users log in using the POST /oauth/login/ssoLogin operation.

Authorization Roles/Permissions: Anyone can run this operation.

This topic includes the following sections:

HTTP Method

POST

Back to top

URL

https://{oauth-provider-url}/oauth/login

Back to top

Sample Request

The example below shows a login request.

Request URL

https://{oauth-provider-url}/oauth/login

Sample request headers

Content-Type: application/x-www-form-urlencoded
Accept: application/json

Sample request body #1: OAuth Admin login

In the example below, the user is the OAuth Administrator. The Domain parameter is included.

identity_email=administrator@acmepaymentscorp&secret_password=password123&Domain=siteusers

Sample request body #2: Site user

The site user logs in with the username.

identity_username=siteuser17&secret_password=MyPassword123

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json
Content-Type application/x-www-form-urlencoded

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
Domain Path string See notes

Domain name parameter:

  • If logging in as a site user, this parameter is not valid.
  • If logging in as the OAuth Administrator, this parameter is required.

Back to top

Response

If successful, this operation returns HTTP status code 200, with:

  • A cookie that will be used for subsequent requests. For non-browser scenarios, the application must save this cookie and include it in every request. The cookie name includes the OAuth Provider name. Cookie name: OAuthToken_{OAuthProviderName}.
  • The UserName and DomainName of the user. Example: { "DomainName" : "Local Domain", "UserName" : "Rep1" }.

Back to top

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/json
Set-Cookie: OAuthToken_acmepaymentscorpoauthdomain=TokenID%3D13439132-4b50-11e5-ad9b-a53b582c6f09%2Cclaimed_id%3D
Local+Domain%5Cadminacmepaymentscorp%2CissueTime%3D1440524299874%2CexpirationTime%3D1440524899733%2Csig%3DYJCYJY8Zc3aOF6b
JhS6wiuaeEGceIL2X_82onuUr49iZWvU_srymQuc0gZtWXbOwTBy5c9Ywlyq8wvZ-odIvupThsaASzZdcpDtYj9d4J0sfsCzHD2gc9zK-lH3g8vVyN-s
z3vWwQIcya77SID6tGGhvjynwSXrst5of2sZ37Cw

Sample response body

The example below is the response after redirects are done.

{
"DomainName": "Local Domain",
"UserName": "adminAcmepaymentscorp"
}

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json
Set-Cookie OAuthToken_{OAuthProviderName}

Back to top

Response Body

Name Type Description
LoginResponse LoginResponse Contains information about the response to an OAuth login request.

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
500 An error occurred processing the call.

More information about Akana OAuth API error messages.

Back to top

Related Topics