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:
owner | access_issuer | direct_access | direct_read_access | login_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.
Parameter | Type | Required | Description |
---|---|---|---|
uuid | string | ✗ | UUID 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. |
id | string | ✗ | ID 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_attribute | string | ✗ | Unique 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_value | string | ✗ | Value 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_uri | string | ✗ | Token exchange URL. |
type_name | string | ✓ | Name of the entity type where the user account is stored.. |
transaction_state | string | ✗ | JSON 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. |
lifetime | integer | ✗ | Number of seconds for which the code is valid. The default is 30 seconds. |
for_client_id | string | ✓ | Client 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"
}
Updated almost 2 years ago