REST API - Asynchronous Authentication OAuth

AnthonyMull
Tera Contributor

Hi Community,

I am building a POC Inbound integration and I would like to use flow designer and action called REST API - Asynchronous.

Can you help me on how I can do this but require OAuth 2.0 for authentication?

Thanks

1 ACCEPTED SOLUTION

@AnthonyMull 

 

Glad to know it is working fine.

 

I hope you appreciate the efforts to provide you with detailed information. As per community guidelines, you can accept more than one answer as accepted solution. If my responses helped to answer your query, please mark it helpful & accept the solution.

 

You can refer below link for OAuth options with examples,

 

https://www.servicenow.com/community/itsm-forum/how-to-generate-access-token-from-the-oauth-token-ur...

 

Thanks,

Bhuvan

View solution in original post

12 REPLIES 12

@AnthonyMull 

 

Thanks for the update.

 

Create or use an existing role 'sys_user_role' to be used for integration

Bhuvan_0-1757315074286.png

Create an user 'sys_user' that will be used for integration and map it with above role and provide any required access for the underlying tables or resources used for inbound integration

Bhuvan_1-1757315180182.png

In the REST API - Asynchronous trigger select 'Requires Authentication' and select 'Required Roles'. ServiceNow will check for the header information when inbound API call is received and make sure only the user mapped with role can call the Inbound REST API. If the incoming API call do not have valid header information or the user is not mapped to the roles, request will fail

Bhuvan_2-1757315345873.png

I hope you appreciate the efforts to provide you with detailed information. If my response helped to guide you or answer your query, please mark it helpful & accept the solution. As per community guidelines, you can accept more than one response as accepted solution.

 

Thanks,

Bhuvan

AnasuyaRampall
Tera Contributor

hi Anthony, I just activated the Integration Hub plugin so I can do this PoC too and maybe find something helpful for both of us. While I do that, may I ask what motivated you to do this PoC in the first place? 

Thank you, any success I have , I will share.

Ankur Bawiskar
Tera Patron
Tera Patron

@AnthonyMull 

check these links

Two way to configure OAuth 2.0 -Outbound Rest integration in Action Designer  -> good article

Configure a REST message with OAuth 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

AnthonyMull
Tera Contributor

Hi @Ankur Bawiskar and @Bhuvan  

I Had success, thanks for help. At a high level here is what I did

1. Create an App registry for OAuth 2.0

2. Create a new user account with only web api access.

3. Created a new role and assigned to user (test_integration role)

4. Used postman to request the OAuth token.

5. Then changed the postman request to use Authorization = OAuth 2.0.

6. PUt in the token, sent request and it worked.

 

Thanks for help