servicenow authorization_code grant flow is not working

Bilal Muzamil
Tera Contributor

Problem:

I am trying to do authorization_code flow in my servicenow instance.

I have the following set up:

 

1. clientId

2. clientSecret

3. redirect_uri

 

After doing log in through UI. I get the code. But when I exchange that code for an access/refresh token. I see:

 

{"error_description":"access_denied","error":"server_error"}

 

Can someone please help me out?

BilalMuzamil_0-1710863150636.png

 

7 REPLIES 7

Hi 
Do you have any workaround for this. I am facing the same issue

Hi Tony. 

 

The documentation link shared in the doc 

BilalMuzamil_0-1710883918721.png

 

redirected me to this

BilalMuzamil_1-1710883947753.png

 

Also the url:

https://<instanceName>.service-now.com/oauth_auth.do?response_type=code&redirect_uri=https://INSTANCENAME.service-now.com/capture_oauthcode&client_id=<client_id>&state=123

 

returned:

BilalMuzamil_2-1710884116529.png

 

Could you please help out? Is it possible for us to jump on a call to move this forward? This is a priority for us

hunt4grouse
Tera Contributor

I am facing the same issue between Datalink and Servicenow. Datalink only uses Grant Type Authorization Code. But when you step an end point to an external client the grant type defaults to Resource Owner Password Credentials. I have been able to update the grant type in the list view to Authorization Code but the connection still does not work. The error on both sides is the same "Missing code_challenge parameter in the request: no thrown error". Did you get yours to work? Any insight is greatly appreciated.