Getting HTTP Error 401 - Unauthorized while trying to access snow using Oauth

reddy8055
Tera Contributor

Hi, 

I am getting HTTP Error 401 - Unauthorized when I click Get Oauth token from rest message. Am I missing anything?

find_real_file.png

Thanks,

1 ACCEPTED SOLUTION

find_real_file.png

 

This is how i had tried . let me know if still its not working

View solution in original post

11 REPLIES 11

Anil Lande
Kilo Patron

Hi,

Please make sure you have entered correct Client ID and Client Secret. Also the grant type selected is same in your another system.

Redirect URL should contain your local ServiceNow instance url and Tokan URL is your provider instance url.

 

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi,

I have corrected the Token URL now when I try to connect from rest I am getting below error message. where can I pass access_taken parameter?

find_real_file.png

Thanks,

 

Can you add more details , where did you setup the user profile, 

Error is coming due to incorrect detail mentioned . 

Hi,

You are using grant type 'Authorization Code', in this case you need to provide authorization URL as well.

I did setup on my two personal instances and it worked fine:

Below configurations are needed in your instance Client Instance:

Authorization URL: https://instance_name.service-now.com/oauth_auth.do

find_real_file.png

 

 

Also you have to copy same redirect url to your provider application setup. (Redirect URL shoul be same in both instances)

As the grant type is 'Authorization Code', when you click on 'Get OAuth Token' Related Link it will redirect you to Authorization page of provider instance, once you allow access by entering user credentials it will redirect back to your instance and will make another call for ACCCESS TOKEN.

find_real_file.png

 

Please Mark helpful and correct answer if this resolves your issue.

Thanks,

Anil Lande

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande