- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 06:35 AM
Hello Community,
My goal with this REST message is to retrieve some information from another system that resides on my local domain. We do not have any domain separation or anything like that configured on our SN instance. I just need SN to reach out via REST to System B and retrieve some information. Sounds simple enough but the problem I am having is a 401 error. Like this...
Now, to me this seems like a very straightforward problem. I'm not successfully authenticating somewhere. My question is...WHERE??? I have removed the requirement for Basic Authentication so AFAIK, there aren't any credentials being passed in the message. To get to this point, I did route the message through a MID Server I have setup on my instance. I am aware that the MID Server requires credentials to do whatever it does. In light of this, I even replaced the MID Server credentials with my credentials because I know I have access to System B. I have logged into System B successfully multiple times.
The other trickery here is that while I am getting this 401 error message when using a REST message in SN, if I copy the endpoint and paste it directly into my browser, it shows me the information I am expecting to see...See below..
So my question is, how can I track down this authentication problem? When I try this from SN, I get the 401 error. When I paste the endpoint directly to the browser, I get the success message above.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 08:56 AM
Hi ken,
In your endpoint you can remove ?apikey=${apikey} and just have till servicegroups. Since you are already passing that message function parameter. Rest of the configuration looks good to me. Also, in the endpoint i..e servicegroups, what kind of content type is being served. Is it html or json? You might want to check the endpoint to see if it html. If so you might have to add that as accept type rather than json.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 08:09 AM
Hi ken,
You will need a basic auth with the same user name password combo apart from Authorization header having the value. Also ensure, inside the method that you are using that you have basic auth and authorization though it should pick up The way to test outside of ServiceNow is to use Postman plugin of browser.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 08:16 AM
I currently have the GET method configured to use Basic Auth alongside the Authorization header. Both are using the same credentials which I have verified will grant me access to System B. I'm still getting the 401 error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 08:26 AM
Hi ken,
Can you add a screenshot of the get message please?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 08:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 08:56 AM
Hi ken,
In your endpoint you can remove ?apikey=${apikey} and just have till servicegroups. Since you are already passing that message function parameter. Rest of the configuration looks good to me. Also, in the endpoint i..e servicegroups, what kind of content type is being served. Is it html or json? You might want to check the endpoint to see if it html. If so you might have to add that as accept type rather than json.