Returns the authentication response object that includes the token, type, scopes, and expiry.
Authentication API
The Authentication API allows you to generate access tokens to authenticate with Ripple APIs.
All API operations require an access token specific to the environment you're using. Ripple provides a secure model for authentication and authorization by providing access tokens scoped for a set of credentials.
The Authentication operation returns an access token in the access_token response field. You must include your client_id and client_secret in the JSON request body to get a valid access token.
You will need your client ID and client secret to obtain an access token.
If you do not already have your client ID and client secret, do the following:
- Log into Ripple Payments UI.
- In the left navigation menu, click Settings.
- Under Administration, click API Credentials.
- In the dropdown list next to the page title, select the access environment. For example, to provision credentials for the test environment, select Test from the dropdown list.
- In the upper right corner of the page, click New Credential.
- Click Save and Generate Key.
Caution: The client secret is displayed only once when you are creating new credentials. You cannot retrieve the secret after exiting this page. Copy and store the client secret securely and share it with authorized individuals in accordance with your organization's security policy.
You can now use the client ID and client secret to generate access tokens using the Authentication operation.
We recommend rotating your API credentials at regular intervals according to your organization's security policy.
Once you have your client ID and client secret, follow these steps to get an access token to use with Ripple Payments Direct API calls:
The first step to request an access token is to determine the environment where you want to use the API.
The following table describes the different environments that provide Ripple Payments Direct API access. Take note of the environment string for the environment you want to access.
| Environment | Request URL | Environment String | Currency |
|---|---|---|---|
| Test | https://auth-test.rnc.ripplenet.com/oauth/token | test | Simulated |
| Production | https://auth.rnc.ripplenet.com/oauth/token | prod | Actual |
Step 2: Request the Access Token
Step 3: Test the Access Token
https://docs.ripple.com/_mock/products/payments-direct/api-docs/auth-proxy/reference/authproxy-external/
Request
Request an access token for authentication with Ripple APIs.
You need to request a token for the environment you want to authenticate with.
Note: The length of the access token isn't fixed, hence it can vary. Avoid validating tokens based on character length.
| Environment | Domain | Description |
|---|---|---|
| Test | auth-test.rnc.ripplenet.com | Test environment with simulated partners and simulated currency. |
| Production | auth.rnc.ripplenet.com | Production environment for Ripple's internal services. |
Optional base64-encoded client_id:client_secret.
If provided here they aren't required in the request body.
- application/json
- application/x-www-form-urlencoded
The client ID associated with a specific set of API credentials.
See API authentication for instructions obtaining your client ID.
The client secret associated with a specific set of API credentials.
See API authentication for instructions obtaining your client secret.
The value of the audience field is based on URN syntax.
Format: urn:ripplexcurrent-{ENVIRONMENT_STRING}:{YOUR_TENANT_ID}
- The first component is
urn:ripplenetxcurrent-. - The second component refers to the environment you want to access.
- The third component is your tenant ID. Ripple integration engineers provide this component during training.
| Environment | Environment string | Description |
|---|---|---|
| Test | test | Test environment with simulated partners and simulated currency. |
| Production | prod | Production environment for Ripple's internal services. |
Example: urn:ripplexcurrent-prod:{YOUR_TENANT_ID}
- Mock server
https://docs.ripple.com/_mock/products/payments-direct/api-docs/auth-proxy/reference/authproxy-external/oauth/token
- Test environment with simulated partners and simulated currency.
https://auth-test.rnc.ripplenet.com/oauth/token
- Production environment for Ripple's internal services.
https://auth.rnc.ripplenet.com/oauth/token
- curl
- Python
- JavaScript
curl -i -X POST \
-u <username>:<password> \
https://docs.ripple.com/_mock/products/payments-direct/api-docs/auth-proxy/reference/authproxy-external/oauth/token \
-H 'Authorization: Basic ZGVtbzpwQDU1dzByZA==' \
-H 'Content-Type: application/json' \
-d '{
"client_id": "{YOUR_CLIENT_ID}",
"client_secret": "{YOUR_CLIENT_SECRET}",
"audience": "urn:ripplexcurrent-prod:{YOUR_TENANT_ID}",
"grant_type": "client_credentials"
}'The bearer token you use when authenticating with a Ripple API.
List of scopes applied to your access_token.
How long your access_token is valid. You need to request a new token when it expires.
{ "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ", "scope": "identities:create identities:read identities:write quote_collections:write payments:accept payments:read routing_table:lookup", "expires_in": 3600, "token_type": "Bearer" }
- Mock server
https://docs.ripple.com/_mock/products/payments-direct/api-docs/auth-proxy/reference/authproxy-external/oauth/token/test
- Test environment with simulated partners and simulated currency.
https://auth-test.rnc.ripplenet.com/oauth/token/test
- Production environment for Ripple's internal services.
https://auth.rnc.ripplenet.com/oauth/token/test
- curl
- Python
- JavaScript
curl -i -X GET \
https://docs.ripple.com/_mock/products/payments-direct/api-docs/auth-proxy/reference/authproxy-external/oauth/token/test \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'[ { "message": "token_ok", "seconds_to_expiry": 3600 } ]