Authorization: User Sign-In
To access the Agentforce IT Service Configuration Management Database (CMDB) GraphQL API, you must authenticate using an OAuth 2.0 Authorization Code flow with user sign-in, so that API calls run under the signed-in user’s identity.
You must have administrator access to your Salesforce org to create Connected Apps.
-
Log in to your Salesforce org as an administrator.
-
Create a Connected App (also known as an External Client App) and retrieve your OAuth credentials (Client ID and Client Secret). For detailed instructions, see Authorization Through Connected Apps and OAuth 2.0.
-
Obtain the authorization code from the Salesforce authorization URL.
Execute the following request to receive an authorization code at your callback URL:
Authorization request:
Use the redirect URI from your Connected App.
-
Exchange your authorization code for an access token.
Submit a POST request to the token endpoint using the code from the previous step:
Use the
access_tokenyou received in theAuthorizationheader for your CMDB GraphQL requests.