Authentication
Learn how to authenticate requests to GenStudio Experience API.
Overview
Every request made to GenStudio Experience API must include an encrypted access token.
Your secure, server-side application retrieves an access token by making a request to the Adobe Identity Management System (IMS) with your Client ID and Client Secret.
Prerequisites
This tutorial assumes you have worked with your Adobe representative and have the following:
- An Adobe Developer Console account.
- A project with GenStudio Experience API OAuth Server-to-Server credentials set up.
- Access to your Client ID and Client Secret from the Adobe Developer Console project. Securely store these credentials and never expose them in client-side or public code.
Retrieve an access token
A temporary access token validates calls to the API. You can generate an access token can directly in the Developer Console, or programmatically by following the steps below.
- Open a secure terminal and export your Client ID and Client Secret as environment variables so that later commands can access them:
export EXP_GS_SERVICES_CLIENT_ID=<Your_Client_ID>
export EXP_GS_SERVICES_CLIENT_SECRET=<Your_Client_Secret>
- Run the following command to generate an access token:
curl --location 'https://ims-na1.adobelogin.com/ims/token/v3' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode "client_id=EXP_GS_SERVICES_CLIENT_ID" \
--data-urlencode "client_secret=EXP_GS_SERVICES_CLIENT_SECRET" \
--data-urlencode 'scope=openid,AdobeID,additional_info.projectedProductContext,read_organizations'
The response will look like this:
{
"access_token": "exampleAccessTokenAsdf123",
"token_type": "bearer",
"expires_in": 86399
}
The response includes an expires_in field that specifies the length of time, in seconds, that the access token is valid. After the access token expires, your application must request a new token.
- Export your access token as an environment variable:
export EXP_GS_SERVICES_ACCESS_TOKEN=<Your_Access_Token>
Make your first API call
[If applicable, include a verification call to the specific API.]