- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 09:02 AM
Hi All,
We are working on a project to implement inbound scripted REST API in service now based on OAuth authentication.OOB service now works as both authorization server to give token and as well as resource server to consume the token for authentication and share the response for an API call.
The difference in our implementation is our client has another tool that can work as an authorization server to generate token as it is the central gateway to authentication and with that token if external application call service now API it should be allowed by OAUTH to provide response.
Kindly let us know any possibility or solution to achieve the requirement.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2020 02:41 AM
I think OIDC would help you in this scenario
below is the example of OIDC with OKTA
https://hi.service-now.com/kb_view.do?sysparm_article=KB0778342
how does it work with ServiceNow
Open ID Connect with OKTA
ServiceNow supports External OIDC Provider and required the following parameters
- Client ID
- Client Secret
- Meta URL
As shown below
We can also set up the user provision so that if the user doesn’t exist in serviceNow and trying to access the ServiceNow APIs with valid external OKTA token we can created the user at runtime and grant the access for APIs accordingly.
As shown below.
Once these configurations are done on ServiceNow side now we can use the external token to access ServiceNow APIs.
So let’s try to get the token from by performing login to OKTA using PostMan as shown below. And his the request token button as shown below
Let’s fill up the user credentials and Sign In
Now as you can see we got the tokens as shown below
Now we can use the Id_token as Authorization to access the ServiceNow APIs and ServiceNow will validate this token with okta and then grant the access accordingly.
As shown below we have successfully received the data using that token from ServiceNow.
please mark this helpful and correct if this helped you in any way.
thanks
Hammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 10:20 AM
Hi Maran,
If you are using Inbound Scripted REST API with OAuth then the 3rd party should be able to generate the access token and refresh token.
In this case only ServiceNow can generate the tokens as it is Authorization Server if external application wants to access ServiceNow resource.
I doubt your scenario can be achieved since the token was generated by other system which ServiceNow may not recognize.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 10:49 AM
Hi
Thanks for the quick response.
Yes, I also was in that understanding but I wanted to explore the solution in another perspective similar to how we can access Microsoft graph API with a token generated from Microsoft Azure as the authorization server. so by that, we can see how azure and graph communicates the Oauth token in the back end.
Any help in the above angle to fit service now is much appreciated!!
if not we doubt that it is not possible for service now to have a separate authorization server and should be within service now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2020 01:59 AM
Hi Maran,
From my experience since the resource or the endpoint you wish to access is being provided by ServiceNow it expects ServiceNow to be the authorization server.
So I doubt ServiceNow currently supports this. If you wish to confirm this you can raise HI ticket with ServiceNow whether it is possibly technically
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2020 02:01 AM
Let me know if I have answered your question.
If yes please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Anukr
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader