get access token through "Connect to a third party OAuth Provider"

asiso
Tera Contributor

Hi, i am trying to connect to servicenow api by a third party OAuth Providor.

i want to use Azure as the third party.

i have created a new application in azure and i have the client ID and client secret.

i worked by this link: https://docs.servicenow.com/bundle/sandiego-application-development/page/administer/integrationhub-s...

 

i registered a new application registry, add the client id and client secret from azure, in the Authorization URL/Token URL/Redirect URL i worked just like it said.

 

then in postman i call a get with this link:

https://login.microsoftonline.com/<Directory ID>/oauth2/v2.0/token

in the body i insert the client id, secret grant type is client_credentials

and scope is my servicenow instance.

i get back a access token but when i try to use it to get data from servicenow i get this error:

{
    "error": {
        "message": "User Not Authenticated",
        "detail": "Required to provide Auth information"
    },
    "status": "failure"
}
when i look at servicenow logs i get this error:
Cannot find oauth_oidc_entity for issuer https://sts.windows.net/<Directory ID>/ with any of the following client_ids: https://MyInstance.service-now.com: no thrown error
 
what do i do wrong?
thanks!
 
 
0 REPLIES 0