Use OAuth to create pipeline credentials
- UpdatedAug 3, 2023
- 4 minutes to read
- Vancouver
- Building applications
Create credential records on each of your instances to enable OAuth use in your pipeline.
Before you begin
Complete the tasks in Create OAuth API endpoints for external clients and Create third-party OAuth provider records.
In the top right corner of your instance, make sure you set the application scope to Global.
Open all of your instances (development, test, production, and the like) in separate browser tabs.
Role required: admin
About this task
To configure credentials correctly, you must create records for each of your production and non-production instances on your production instance. Then, you must create a record for your production instance on each of your non-production instances connecting them all together. Use the videos in each section to follow along with the steps. Begin on your production instance.
Procedure
- On your production instance, navigate to All > Connections & Credentials > Connection & Credential Aliases.
- Select New.
- Change the Type to Credential.
- In the Name field, enter Pipeline Dev OAuth.
- Select Submit.
- Reopen the record you just created (Pipeline Dev OAuth).
- On the Credentials related list, select New.
- Select OAuth 2.0 Credentials.
-
On the form, fill in the fields.
Table 1. OAuth 2.0 Credentials form Field Action Name Enter Dev OAuth. OAuth Entity Profile Search for and select the Dev Instance Connection default profile. - Select Submit.
-
Reopen the Dev OAuth credential record.
An expected error appears, directing you to verify the OAuth configuration and select Get OAuth Token to request a new token.
-
Under Related Links, select Get OAuth Token.
A development instance opens requesting to connect to your ServiceNow account.
- Select Allow.
- Go back to the Connection & Credential Aliases list (All > Connections & Credentials > Connection & Credential Aliases).
- Select New.
- Change the Type to Credential.
- In the Name field, enter Pipeline Test OAuth.
- Select Submit.
- Reopen the record you just created (Pipeline Test OAuth).
- On the Credentials related list, select New.
- Select OAuth 2.0 Credentials.
-
On the form, fill in the fields.
Table 2. OAuth 2.0 Credentials form Field Action Name Enter Test OAuth. OAuth Entity Profile Search for and select the Test Instance Connection default profile. - Select Submit.
-
Reopen the Test OAuth credential record.
An expected error appears, directing you to verify the OAuth configuration and select Get OAuth Token to request a new token.
-
Under Related Links, select Get OAuth Token.
A test instance opens requesting to connect to your ServiceNow account.
- Select Allow.
- Go back to the Connection & Credential Aliases list (All > Connections & Credentials > Connection & Credential Aliases).
- Select New.
- Change the Type to Credential.
- In the Name field, enter Pipeline Prod OAuth.
- Select Submit.
- Reopen the record you just created (Pipeline Prod OAuth).
- On the Credentials related list, select New.
- Select OAuth 2.0 Credentials.
-
On the form, fill in the fields.
Table 3. OAuth 2.0 Credentials form Field Action Name Enter Prod OAuth. OAuth Entity Profile Search for and select the Prod Instance Connection default profile. - Select Submit.
-
Reopen the Prod OAuth credential record.
An expected error appears, directing you to verify the OAuth configuration and select Get OAuth Token to request a new token.
-
Under Related Links, select Get OAuth Token.
A production instance opens requesting to connect to your ServiceNow account.
- Select Allow.
- (Optional)
If you have any other non-production instances (staging, etc.), create a credential record for each of them on your production instance using the methods above.
Important: After you've completed the steps above on your production instance, follow the steps below to create one credential record on each of your non-production instances connecting them to your production instance. Complete the next steps on your development instance.
- On your development instance, navigate to All > Connections & Credentials > Connection & Credential Aliases.
- Select New to create a record to connect your development instance to production.
- Change the Type to Credential.
- In the Name field, enter Pipeline Prod OAuth.
- Select Submit.
- Reopen the record you just created (Pipeline Prod OAuth).
- On the Credentials related list, select New.
- Select OAuth 2.0 Credentials.
-
On the form, fill in the fields.
Table 4. OAuth 2.0 Credentials form Field Action Name Enter Prod OAuth. OAuth Entity Profile Search for and select the Prod Instance Connection default profile. - Select Submit.
-
Reopen the Prod OAuth credential record.
An expected error appears, directing you to verify the OAuth configuration and select Get OAuth Token to request a new token.
-
Under Related Links, select Get OAuth Token.
A production instance opens requesting to connect to your ServiceNow account.
-
Select Allow.
Important: Complete the next steps on your test instance.
- On your test instance, navigate to All > Connections & Credentials > Connection & Credential Aliases.
- Select New to create a record to connect your test instance to production.
- Change the Type to Credential.
- In the Name field, enter Pipeline Prod OAuth.
- Select Submit.
- Reopen the record you just created (Pipeline Prod OAuth).
- On the Credentials related list, select New.
- Select OAuth 2.0 Credentials.
-
On the form, fill in the fields.
Table 5. OAuth 2.0 Credentials form Field Action Name Enter Prod OAuth. OAuth Entity Profile Search for and select the Prod Instance Connection default profile. - Select Submit.
-
Reopen the Prod OAuth credential record.
An expected error appears, directing you to verify the OAuth configuration and select Get OAuth Token to request a new token.
-
Under Related Links, select Get OAuth Token.
A production instance opens requesting to connect to your ServiceNow account.
- Select Allow.
- (Optional) If you have any other non-production instances (staging, etc.), create a credential record on that instance for production using steps 54-66.
What to do next
Now that you've created all of the credential records connecting your instances, you can use those records to configure your pipeline environments. For more information, see Configure your pipeline environments.