Oauth2 authorization url generated by ServiceNow appending extra "&" to response_type

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2018 10:45 PM
We are using OAUTH2 for REST messaging and "authorization code" as a grant type.
Our authorization URL is : https://our_authorization_server/oauth2/authorize
The URL generated by ServiceNow to get the OAuth token is as follows :
https://our_authorization_server/oauth2/authorize
?&response_type=code
&redirect_uri=https://dev1234.service-now.com/oauth_redirect.do&client_id=1234585885869459430303003
The issues we are facing is :
1] &response_type=code
The parameter response_type has "&" prepended to it , which causes our authorization API to fail.
2] value of parameter "state" is not being set in the URL.
How can we set value for parameter "state" in ServiceNow.
Thanks! In advance
Message was edited by: Manasi Amale

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 12:55 AM
I have worked on oauth so can u please elaborate

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 12:56 AM
Are u using any active directory

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 01:30 AM
Hi Pranav,
Thanks for the reply.
We are not using active directory.
We are using our own Identity Management Service to authorize the ServiceNow request.
Here are the steps we follow :
1] Create oauth profile in oauth -> application registry , we mention authorize API here (please find the screenshot)
2] Use the profile for REST messaging in outbound -> REST messages
3] Now when we hit "Get OAuth Token", service-now redirects with following URL
https://our_authorization_server/oauth2/authorize
?&response_type=code&redirect_uri=https://dev1234.service-now.com/oauth_redirect.do&client_id=1234585885869459430303003
Please note : service-now has appended & before "response_type" parameter which is causing our parsing to fail.
Any idea what is the reason for this ?
Also how can we send parameter "state" in service-now.
Please let me know if further clarifications are required

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2018 03:30 AM
So you are using some 3rd part like google for username and password?