The CreatorCon Call for Content is officially open! Get started here.

Getting Oauth Token in Scope vs Global

ttakahashi
Tera Contributor

I needed to create an Application Registry to get an Oauth Token from a third-party provider.

 

I defined the application registry and related the Oauth entity profile to a Oauth 2.0 credential.

 

I had all of this defined in a custom spoke - had issues getting a token.

 

I defined everything the same in Global, and had no had no issues getting a token. 

 

Is there something missing? Why would setting up Oauth in a custom spoke have issues getting the token?

5 REPLIES 5

ColeM
Tera Expert

I'm experiencing the same behavior. 

MugTm09
Giga Guru

Hello, @ttakahashi .
To retrieve the token, you may need to create a custom “OAuth API Script” as needed.
How you should customize it from the OTB version depends on the API specification of the system from which the token is being obtained

anurampalli
Tera Contributor

Scope should not cause an issue with receiving a token.

 

I just created an application registry within a scoped application and created a user with role "snc_platform_rest_api_access".

 

I made a POST call from postman and successfully received a token. Attached are screenshots for your reference.

 

Postman Receive Access Token.pngRegistry.pngUserWithRole.png

 

anurampalli
Tera Contributor

 I read the rest of the replies and can't help feeling I missed something. 

Did you setup OAuth in one ServiceNow instance and trying to request a token from another?

 

In that case, you must make a few adjustments. Do let me know if you need that information. Basically, you have to designate the user you have the role to in "OAuth Application User"

If you need this information as well, I will give screenshots.