Configuring OAuth External OIDC Provider for inbound REST API requests

Jono1
Kilo Explorer

Greetings,

I have been attempting to use an External OAuth Provider to allow access to my SN instance's REST API. I am able to generate the needed token but when making a API request I receive a 401 error. When checking the SN error log I have the error:

Cannot find oauth_oidc_entity for issuer https://{oauthIssuer} with any of the following client_ids: {issuerApplicationId}: no thrown error

I have a 'External OIDC Provider' configured for this and am not clear on where the error is pointing me.

Thank you.

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Jono,

So you are trying to consume ServiceNow endpoint via OAuth.

Are you getting the access token in the first step?

Can you share how are you calling the API?

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Thanks for replying. being new to ServiceNow I'm going in the deep end. I'm actually trying to use Azure AD to manage users and issue authorization. I can obtain a token from AD, the error appears when I call SN.

I am calling the API:

https://{instance}.service-now.com/api/now/table/incident

Headers:

GET /api/now/table/incident HTTP/1.1
Host: {instance}service-now.com
Authorization: Bearer {Access_Token}
Accept: application/json
cache-control: no-cache

There has to be a disconnect between AD and SN, I'm not clear on where.

-Jono

Is your Open Id connect passing you an id_toke ? Apart from Access token and Refresh toke ?

Hi Aman,

 

Yes, I receive all three.