You are here:
Initiate the Authorize Endpoint for the Linked Org
After org 2 is configured to reference org 1’s global settings file, initiate an OAuth flow to acquire an access token.
These steps are similar to the OAuth 2.0 Web Server Flow for Web App Integration. For more information, see OAuth 2.0 Web Server Flow for Web App Integration.
- Copy the consumerKey from the global settings file. This value exists in the global settings file only after you deploy and retrieve the External Client App OAuth settings.
- Paste org 2’s URL and the consumer key into this URL in place of <new org url> and
<consumerKey>.
<new org url>/services/oauth2/authorize?response_type=code&client_id=<consumerKey>& redirect_uri=https://www.example.com - To initiate the request for access, open the URL in a browser.
- Sign in with org 2 credentials.You’re redirected, and an authorization code is in the URL.
- Copy the authorization code from the URL in the browser.
- Decode the authorization code.
- Copy the decoded authorization code.
- Replace these values in the cURL request.
- Replace <new org url> with the org’s URL.
- Replace <authorization code> with the decoded authorization code from step 6.
- Replace <clientKey> with the consumerKey field value from the global OAuth settings file.
- Replace <clientSecret> with the consumerSecret field value from the global OAuth settings file.
curl -X POST <new org url>/services/oauth2/token -d 'grant_type=authorization_code&code=<authorization code>&client_id=<clientKey>&client_secret=<clientSecret>&redirect_uri=https://www.example.com' | json_pp - Enter the configured cUrl request into the terminal.
- A successful request returns the access token.
- Verify that the access token works using Postman. Try accessing the UserInfo endpoint.

