Configure Your Trailhead Org
To configure your Trailhead org, set up Cross-Origin Resource Sharing (CORS) and a connected app.
Set up CORS and your connected app.
CORS allows code running in a web browser to communicate with Salesforce from a specific origin. To add the URL patterns for Postman:
-
In your Trailhead Playground, from Setup, in the Quick Find box, enter
cors, and then select CORS. -
In the Allowed Origins List, click New.
-
Enter
https://*.postman.comas the Origin URL Pattern. -
Save your work.
-
Click New, and enter
https://*.postman.comas the Origin URL Pattern. -
Save your work again.
To set up your connected app:
-
From Setup, in the Quick Find box, enter
App Manager, and then select New Connected App. -
Enter the app name in the Connected App Name field, and enter your email address in the Contact Email field.
-
Under API Heading, select Enable OAuth Settings.
-
Enter the callback URL:
https://oauth.pstmn.io/v1/callback. -
Select Use digital signatures.
-
Select Choose File, and then select the host.crt file from your private public keypair.
-
Under Selected OAuth Scopes, select the Manage user data via APIs (api) and the Perform requests at any time (refresh_token, offline_access) scopes.
-
Deselect Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flow.
-
Save your work.
-
On the connected app details page, click the Manage Consumer Details button. This action triggers a verification code sent to your email. Then you can see the Key and Secret values.
-
At the top of the new connected app, click Manage, and then select Edit Policies.
-
Under IP Relaxation, select Relax IP restrictions, and save your changes.