Access Tokens and Code

Janrain Registration utilizes several OAuth access tokens and codes through both the social and traditional authentication process. Below is an overview of each type of token and the context in which each is used.

Access Tokens

Access tokens are provisioned after a successful authentication through Janrain Registration when the response type is set to token in the JavaScript settings or as an API parameter.

They allow for scoped, time-limited access to the Janrain user profile database through the Registration UI. They may also be used as authentication for some /entity endpoints instead of a client ID and secret.

Access tokens are bearer tokens and are only valid for one hour by default. The lifetime can be configured differently by Janrain Professional Services, but an expiration of longer than one hour is not recommended for security reasons. Access tokens may be refreshed using the oauth/token endpoint or provisioned manually using the access/getAccessToken endpoint.

Authorization Codes

Authorization codes are provisioned after a successful authentication through Janrain Registration when the response type is set to code in the JavaScript settings or as an API parameter. A code must be exchanged for an access token with the oauth/token endpoint for access to the Janrain user profile database.

They are also generated in the reset password workflow and appended to the base URL set in the the password_recover_url client setting. The lifetime of the code in the reset password link is configurable in the recover_code_lifetime client setting.

Authorization codes may also be provisioned manually through the access/getAuthorizationCode endpoint.

Each authorization code is valid for one-time use only.

IDP Tokens

IDP tokens are provisioned by an IDP (Identity Provider) after a successful social authentication. They allow for scoped, time-limited access to user data through the IDP’s APIs. IDP tokens must be converted into a Social Login token with the signin/oauth endpoint for use with Janrain Registration.

Refresh Tokens

Refresh tokens are only returned in the response of a successful oauth/token call when exchanging an authorization code or a previous refresh token for an access token. This allows for infinitely refreshable access tokens.

Each refresh token does not have an expiration time and is valid for one-time use only.

Social Login Tokens

Social Login tokens are provisioned after a successful authentication through Janrain Social Login. They allow for scoped, one-time access to user data through the auth_info endpoint.

These tokens are also used to complete the social authentication process in API-based Registration implementations with the oauth/auth_nativeoauth/register_native , and oauth/auth_native_traditional endpoints. For normal login or registration, a Social Login token will be passed into the token parameter, and for an account merge process a Social Login token will also be passed into the merge_token parameter.

Social Login tokens may be provisioned manually using the signin/oauth endpoint in exchange for an IDP token.

Verification Codes

Verification codes are generated in the email verification workflow and appended to the base URL set in the the verify_email_url client setting. The lifetime of the code in the reset password link is configurable in the verification_code_lifetime client setting.

Verification codes may also be provisioned manually through the access/getVerificationCode endpoint.

Each verification code is valid for one-time use only.