POST /api/login/pendingtasks

Used if a custom user workflow is in use in the platform that requires custom tasks; for example, entering a two-factor verification code. In this scenario, this operation allows a user to log in, guiding the user through any pending tasks that are needed, including custom tasks, such as 2FA verification, and any standard tasks, such as accepting a legal agreement or changing the password.

With the platform's default workflow, the POST /api/login operation initiates the login process. If a custom workflow is in effect with custom pending tasks, the POST /api/login/pendingtasks operation manages the custom task.

This operation links the user request into a workflow action in a custom user workflow controlling the custom login tasks. Multiple custom login tasks can be introduced, as long as the workflow is updated to reflect each task. This provides an API layer that links into the workflow action to resolve login pending tasks.

This operation links into the @ResolveLoginPendingTask workflow initial action.

Authorization Roles/Permissions: To complete this operation successfully, a user must be registered on the platform or be in process of registering.

This topic includes the following sections:

HTTP Method

POST

URL

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

Sample Request

The example below shows the response to this operation. In this example, a two-factor authentication task is pending (implemented with a custom workflow).

Sample Request URL

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

Sample request headers

POST {hostname}/api/login/pendingtasks HTTP/1.0
Host: {hostname}
Accept: application/json
Content-Type: application/json; charset=UTF-8

Sample request body

In the example below, a two-factor authentication task is pending (implemented with a custom workflow). The requests message includes the two-factor authentication code.

{
  "parameters":{
    "2fa.verification.code":"298810",
    "Action":"validate"
  },
  "taskID":"2fa.required"
}

Request Headers

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

Header Description
Accept application/json, application/vnd.soa.v72+json
Content-Type application/json, application/vnd.soa.v72+json

Request Parameters

Parameter Parm Type Data Type Required Description
ResolveLoginPendingTaskRequest Body ResolveLoginPendingTaskRequest Required Contains information about a custom login task that is pending for the current user.

Response

If successful, this operation returns HTTP status code 200, with the login response showing the next pending login task. If there are no pending login tasks, the user is fully logged in with a login status of login.complete.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/json
Expires: Wed, 09 Sep 2015 13:30:45 GMT

Sample response body #1

In the example below, the user must also accept the platform's legal agreement as part of the login process.

{
  "pendingAgreements" : [ "signupagrmtv1.acmepaymentscorp" ],
  "pendingTasks" : [ "force.accept.agreements" ],
  "loginState" : "login.inprocess",
  "pendingNotifications" : 0
}

Sample response body #2

In the example below, the user has completed all login tasks and is fully logged in.

{
  "loginState" : "login.complete",
  "pendingNotifications" : 0
}

Response Headers

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

Header Description
Content-Type application/json, application/vnd.soa.v72+json

Response Body

Name Type Description
LoginResponse LoginResponse

Contains information returned as a result of logging in.

Depending on the scenario, the response might include information on the next login task the user must complete, or might include 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
500 An error occurred processing the call.

More information about Akana API Platform API error messages.