Get an authorization code

Returns an authorization code that can be exchanged for an access token and a refresh token.

API client permissions

The following table indicates the API clients that can and can't be used to call this operation:

owneraccess_issuerdirect_accessdirect_read_accesslogin_client

Authentication

This operation supports both Basic authentication (recommended) and janrain-signed authentication. See Get started for more information.

Base URL

The base URL for this operation is your Identity Cloud Capture domain; for example:

https://educationcenter.us- dev.janraincapture.com

Your Capture domain (also known as a Registration domain) can be found in Console on the Manage Application page.

Examples

Example request

This command returns an authorization code for the user with the ID 11521.

curl -X POST \
  -H "Authorization: Basic dXQ0YmdycmE3dzI4MmpjZm15cGZxeDlwemhxaGpqMmI6dW5qemU5bndrZnV5NmpwdzgzOHFwYTdhZDNoZG55YTY="\
  --data-urlencode redirect_uri=http://documentation.janraincapture.com/oauth \
  --data-urlencode id=11521 \
  --data-urlencode type_name=user \
  https://my-app.janraincapture.com/access/getAuthorizationCode

Parameters

All parameters need to be configured as x-www-form-urlencoded body parameters.

ParameterTypeRequiredDescription
uuidstringUUID of the user account. This parameter is required unless you are using either the id parameter or the key_attribute parameter to identify the user account.
idstringID of the user account. This parameter is required unless you are using either the uuid parameter or the key_attribute parameter to identify the user account.
key_attributestringUnique attribute found in the user account schema. This parameter is required unless you are using either the id parameter or the uuid parameter to identify the user account.
key_valuestringValue assigned to the key_attribute parameter. This parameter is required is you're using the key_attribute parameter to identify the user account. For example, if key_attribute is set to email then key_value needs to be set to the user's email address.
redirect_uristringToken exchange URL.
type_namestringName of the entity type where the user account is stored..
transaction_statestringJSON object associated with the authorization code and returned when it's exchanged for an access token and a refresh token. You determine what data is returned.
lifetimeintegerNumber of seconds for which the code is valid. The default is 30 seconds.
for_client_idstringClient ID of the API client used to retrieve the authorization code.

Responses

200 OK

Response Example (application/json)

If your API call succeeds the response includes an authorization code.

{
  "authorizationCode": "12345678912345",
  "stat": "ok"
}