Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to use GlideOAuthClient to get access token from Azure

TechTurtle
Tera Contributor

Hello,

We have enabled SSO with Azure AD as a result users who are in Azure Ad can SSO to login to ServiceNow.

Now, we need to call another API from ServiceNow. The API expects Azure OAuth token.

I am struggling for any good example which can show how to obtain this token so that we can pass it to another API.

 

I am considering to use Application Registry and then use GlideOAuthClientRequest to request token, however, I am not getting any good example (even the official documentation is not enough around it).

 

I tried: https://www.servicenow.com/community/architect-forum/ms-graph-oauth-2-0-integration-best-practice-qu...

but the author didn't provide much details ( I am new to ServiceNow).

 

Can someone who have acquire OAuth token from Azure please share the steps?

 

Thank you.

5 REPLIES 5

AmalY
Tera Contributor

Hi I am having the same issue please if you figured out let me know. my current login with AZURE AD is SAML All I need to get JWT access token from logged in user in order to use it with other APIs.