POST /oauth/login/renewToken

Renews an OAuth authentication token. Uses HTTP POST.

The OAuthToken cookie set up by the login/ssoLogin API calls is valid for only 10 minutes. Before the token expires, you can renew it for another 10 minutes.

Note: there is a corresponding operation that performs the same action using HTTP GET: GET /oauth/login/renewToken. For information on why you might choose one or the other, see OAuth Operations: GET or POST?

Authorization Roles/Permissions: Anyone can run this operation.

This topic includes the following sections:

HTTP Method

POST

URL

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

Sample Request

The example below shows a request to renew a token.

Sample Request URL

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

Sample request headers

Content-Type: application/x-www-form-urlencoded
Accept: application/json
Cookie: OAuthToken_{OAuthProviderName}={Cookie value (usually starts with TokenID)}

Sample request body

None.

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

Request Parameters

None.

Response

If successful, this operation returns HTTP status code 200. The response includes 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 response includes the UserName and DomainName of the user.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/json

Content-Type: application/json
Set-Cookie: OAuthToken_acmepaymentscorp: TokenID%3D57d30fc7-240e-11e5-a1b9-8945fbb2b0eb%2Cclaimed_id%3DLDAP_acmepaymentscorp%5Ceng100
%2CissueTime%3D1436207972636%2CexpirationTime%3D1436208572626%2Csig%3DlOsIenU6JM-dYquJKhKMdKarQRtef4ALY5Abuls7KV5jaPgWapM1w0Y
thq0I1hJvMJ7xlWj8haU3OvM4b6I3LgGWGvw5_Uws935JKLW57xiti_UC2IvxFDrAIg4xx2k-x-icqUDsWfVGNfjWlun43_uRM667RjGOkh_ZmU2xq0Q

Sample response body: application/json

{
  "DomainName" : ldap",
  "UserName" : eng100"
}

Response Headers

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

Header Description
Content-Type application/json
OAuthToken_{OAuthProviderName} The OAuth token cookie.

Response Body

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

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.