- Developing Live Experience
- Retrieve a JWT Access Token Using the Auth REST Call
Retrieve a JWT Access Token Using the Auth REST Call
Implement your own JSON Web Token (JWT) request system.
- From the navigation menu, select Applications.
- On the Applications page, select your application and then select the Details tab.
-
Make note of the Client ID and retrieve the Client Secret from your tenant
administrator.
Warning: Click Display Secret and Generate only if you haven't been provided a secret by your tenant administrator. Generating a new secret will cause any authorization configuration you have in place to be invalidated.
-
Send a REST GET request using the clientID and clientSecret from the Admin
Console to one of the following Live Experience access token REST endpoints:
-
GET https://live.oraclecloud.com/auth/apps/api/access-token
or, for EMEA customers
-
GET https://emea.live.oraclecloud.com/auth/apps/api/acess-token
Include the following access token request header:
Authorization: Basic encoded{clientId, clientSecret}
Where clientId and clientSecret are the credentials you've retrieved from the Admin Console.
The actual REST call itself will look something like this, where:grant_type
query parameter indicates the type of access token grant requested. This must beclient_credentials
.&nonce
can equal any random number from 1 to 1,000,000.&state
is returned to the client to help mitigate CSRF attacks. The value can be any number.
https://live.oraclecloud.com/auth/apps/api/access-token? grant_type=client_credentials &nonce=360468 &state=0 &scope=optional
Note: The request is shown here with carriage returns added to promote its readability. For more information on access token requests, see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3.
In response to this REST GET request, Live Experience will send you theaccess_token
in a JSON-formatted response body.{ "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJhd.....", "expires_in": "3600", "id_token": "eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJQcmVtaWVyIiwiaXNzIjoiZGVuM....", "state": "0", "token_type": "Bearer" }
The following table describes the key and value pairs returned in the response body.Key and Value Pair Description
Key Example Value Description access_token "abc123zyx987..."
The access token required to authenticate with Oracle Live Experience. This is also referred to as a JWT. expires_in "1200"
The expiry time in seconds. The default is 1200 seconds (20 minutes). id_token
"zza3443kslle..."
An ID token. This is not used. state
"0" The request state. This will always be 0 unless an error occurs. token_type
"Bearer"
The type of access token. This will always be Bearer. -
-
You can then retrieve the
access_token
value within your application using the examples described in the following:- JavaScript: Authenticate with Live Experience for the Web
- Swift (iOS): Authenticate with Live Experience for iOS
- Java (Android): Authenticate with Live Experience for Android