GET /api/login/status

Returns information about the current user's login status, including whether there is a pending login task that the user must complete as part of the login process.

The user is detected by the presence of the platform cookie.

This operation can be used at any time to determine the next step in the login process. If a login pending task is required, only the next task is returned. When that task is complete, run this operation again to check whether there is an additional login task or the login process is now complete. The response is the same response as the POST /api/login operation.

Authorization Roles/Permissions: No permission required.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/login/status

Sample Request

The example below shows a request for the login status for the user logging in.

Sample Request URL

https://{hostname}/api/login/status

Sample request headers

GET http://{hostname}/api/login/status HTTP/1.0
Host: {hostname}
Accept: application/json

Sample request body

Not applicable.

Request Headers

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

Header Description
Accept application/json, application/xml, application/vnd.soa.v71+json, application/vnd.soa.v71+xml, application/vnd.soa.v72+json, application/vnd.soa.v72+xml, application/vnd.soa.v80+json, application/vnd.soa.v80+xml, application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Request Parameters

None.

Response

If successful, this operation returns HTTP status code 200, with information about the user's login status and any pending tasks.

Sample Response #1: 2FA

In the example below, login is initiated. Custom workflow is in place and two-factor authenticaction is required, so the user is directed to this task.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/json
Expires: Tue, 08 Sep 2015 15:45:55 GMT

Sample response body

{
  "pendingTasks" : [ "2fa.required" ],
  "pendingTaskData" : {
    "2fa.required" : {
      "attemptsLeft" : 3,
      "codeLength" : 6,
      "status" : {
        "status" : "",
        "statusCode" : "",
        "statusMessage" : ""
      },
      "codeValidFor" : 0,
      "codeSentTo" : "",
      "codeSent" : true,
      "type" : ""
    }
  },
  "loginState" : "login.inprocess",
  "pendingNotifications" : 0
}

Sample Response #2: login tasks in process

In the example below, there is still at least one pending task the user must complete to be fully logged in.

Sample response body

{
  "pendingAgreements" : [ "signupagrmtv1.acmepaymentscorp" ],
  "pendingTasks" : [ "2fa.required" ],
  "pendingTaskData" : {
    "2fa.required" : {
      "attemptsLeft" : 3,
      "codeLength" : 6,
      "status" : {
        "status" : "",
        "statusCode" : "",
        "statusMessage" : ""
      },
      "codeValidFor" : 300,
      "codeSentTo" : "",
      "codeSent" : true,
      "type" : ""
    }
  },
  "loginState" : "login.inprocess",
  "pendingNotifications" : 0
}

Sample Response #3: login complete

In the example below, there are no pending tasks. The user logs in and login is complete.

Sample response headers: application/json

HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 26 Jul 2018 13:21:56 GMT

Sample response body

{
  "userName" : "adminAcmePaymentsCorp",
  "loginState" : "login.complete",
  "avatarURL" : "http://acmepaymentscorp.com/api/users/6b5c2dc3-6cc6-4d87-8698-edb493bcada0.acmepaymentscorp/avatar",
  "userFDN" : "6b5c2dc3-6cc6-4d87-8698-edb493bcada0.acmepaymentscorp",
  "pendingNotifications" : 0
}

Response Headers

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

Header Description
Content-Type application/json, application/xml, application/vnd.soa.v71+json, application/vnd.soa.v71+xml, application/vnd.soa.v72+json, application/vnd.soa.v72+xml, application/vnd.soa.v80+json, application/vnd.soa.v80+xml, application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Response Body

Name Type Description
LoginResponse LoginResponse Contains information returned as a result of logging in. User name and FDN, along with an authorization token and the pending notifications count for the user.

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
404

The resource could not be found.

For example, you might get this if the user hadn't logged in (no login cookie present).
406 Not Acceptable. Returned if there is a problem with the request format. For example, you would get this if you specified an incorrect media type for the Accept header.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.