OAuth 2.0 and Rest Message Error

Afshin_Lakzadeh
Tera Contributor

Hi,

 

We have an integration to another ServiceNow instance via OAuth 2.0 and Rest Message. We've encountered problems with the integration and found out that there were issues related to user authentication. The integration user was deleted. The user is now created again, and we receive the token via Postman.

 

To get the integration running, I clicked on "Get Oauth Token" and entered the user id and password for the integration user. This works fine, and I received the token back.

 

However, when I now test the integration from an Incident, it works fine forme as user, but for all the other users who need to use the integration, they get a response status code 401 "User Not Authenticated. Could not retrieve a new access token with the refresh token. server_error, access_denied."

 

What have I done wrong?

 

Thank you in advance.

2 REPLIES 2

gowdash
Mega Guru

Rajesh Chopade1
Mega Sage

hi @Afshin_Lakzadeh 

When you manually obtained the token via Postman, it was likely for your specific user account. However, other users might not have the same permissions or settings, leading to the "User Not Authenticated" error.

 

If other users are trying to use the same integration, ensure that they have the appropriate permissions to authenticate with the OAuth provider and access the necessary resources.

 

If your OAuth provider restricts tokens by user or scope, the refresh token might not work across different users unless they are properly authorized in the provider.

Have you checked with other user account on Postman?

If the issue persists, you might need to reset the OAuth setup and ensure all users can authenticate as needed.

I hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

Rajesh