Configure an OAuth OIDC provider for accepting third-party token
Configure an OAuth OpenID Connect (OIDC) provider to accept identity tokens generated by a third-party OIDC provider using inbound API calls using Single Sign-On option (Multi-Provider SSO).
Avant de commencer
Pourquoi et quand exécuter cette tâche
The ServiceNow AI Platform supports OpenID Connect (OIDC) through the external Single Sign-On (SSO) implementation in addition to inbound API calls.
For an example of an OIDC provider configuration, see Set up Microsoft Entra ID spoke. For an SSO-specific example of an OIDC provider configuration, see Create an OpenID Connect (OIDC) configuration for Single Sign-On (SSO).
Procédure
The following is an example of a cURL request to invoke a REST API call
Invoke a REST API call.Perform the following steps:
- Register the app in the OpenID Connect Provider.
- Configure the OAuth OIDC Entity.
- Configure the OIDC Provider:
Tableau 1. OIDC Provider OIDC Provider Name of the OIDC provider. OIDC Metadata URL Specify the OIDC Metadata URL (well-known configuration URL). This information is used to fetch the public keys to validate the token through the jwks endpoint. User Claim The the claim which is validated against user table. User Field User claim which identifies user record. Enable JTI claim verification When enabled, the ServiceNow JWT token validation will also validate the JTI sent by the provider. Remarque :If validation isn’t checked, the jti can’t be validated, regardless if it’s present in the JWT token. The claim name in the token must be jti. This information is used to help prevent replay attacks. - Get a JWT token.
- Invoke a REST API call.
- The ID token in the Authorization header to access Table API or scripted web
service.
curl -X GET --header "Accept:application/json" https://<instance_name>.service-now.com/api/now/table/incident/897b04f2dbd4a300a135364e9d961952 -k --header "Authorization: Bearer eyJraWQiOiJjNTZtZTlXU0xPVnY3UFMwcTg4Qzl1b0lzNjFQYTdmUG4yZFVFOW9RNUg4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwMHVnZDg1OD VkczI1WXpUSjBoNyIsIm5hbWUiOiJpbXJhbiBhbGkiLCJsb2NhbGUiOiJlbi1VUyIsImVtYWlsIjoiaW1yb241NDNAZ21haWwuY29tIiwidmVyIjoxLCJpc3MiOiJodHRwczovL2Rldi05MzQ xMjEub2t0YXByZXZpZXcuY29tIiwiYXVkIjoiMG9hZ2Q4bzk3a2lCT3dwd0IwaDciLCJpYXQiOjE1Mzc5MzMzMjYsImV4cCI6MTUzNzkzNjkyNiwianRpIjoiSUQueThVdXpWNUg2bm16SzRs OTI1RFVrQnJoR1o1MmJzVVpGVHRVTEphQjg3ayIsImFtciI6WyJwd2QiXSwiaWRwIjoiMDBvZ2Q4NTgycEFqZDZTemcwaDciLCJub25jZSI6InNub3ciLCJwcmVmZXJyZWRfdXNlcm5hbWUiO iJpbXJvbjU0M0BnbWFpbC5jb20iLCJnaXZlbl9uYW1lIjoiaW1yYW4iLCJmYW1pbHlfbmFtZSI6ImFsaSIsInpvbmVpbmZvIjoiQW1lcmljYS9Mb3NfQW5nZWxlcyIsInVwZGF0ZWRfYXQiOj E1Mzc5MzAxOTcsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhdXRoX3RpbWUiOjE1Mzc5Mjk2NjF9.OG87SYxWFgHGlhBYby2H79diRm9rlYZTeEkIINRUatwg-p4739htB8xEY-5_t6yU_6k5w1 0pdgtt5M5QFZRPXVbQZNoGtY-Bxn0BjaimcFgoWfhY_0ldnGTkzN2RYyIHvrf9-yhxg347zvczmLrgMMa_VwG4rxrtE6rUXaIpIeIK5b-Deq8ADz8UTUTKpF_5RWk4X-oh5xK6BLniFHk4ShO Zq2v_mjproXwKk5euJKrVrar2lQ4adZCOSTRuTf3ThMO5WDh0sel-82LngXtLzRJJ51IqxAsXns0kJHLLqLtH1hXNRKfwT1ScQoE_OfWm4t0KryI2j4wSMEanFtLXIw" - If the user is authenticated, a valid application/json response is returned. Otherwise, a "User Not Authenticated" error message is returned.
User Not Authenticated {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
- The ID token in the Authorization header to access Table API or scripted web
service.