Oauth token request to Sharepoint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 12:01 AM
Hello,
I am trying to request a token from Sharepoint using Oauth 2.0. So I've setup in ServiceNow the Oauth application registry and the Outbound REST, but when I click the Get Ouath Token button, this is what i get back in the response Body: "The request body must contain the following parameter: 'resource' "
I suppose I should send the resource parameter in the Oauth script include I've attached to the application registry, but I'm not sure where exactly in the script to add it and how to send it for Sharepoint to recognize and accept it.
Does anyone have any ideas on this?
Thank you.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2018 11:19 PM
Hello,
Sorry for the late reply. So the URL you gave above describes very well what I have in the instance. I tried with the default script include (just copied the oob one); and what happens is this:
1. I get redirected to Sharepoint and asked to trust the application:
2. So i hit Trust and then this message pops-up:
3. Because I've logged in my Script include the contentType and contentBody I check the logs:
4. With Postman I can successfully do the call to Sharepoint and get back an access token, by adding the resource parameter in the request body:
Now the problem is that I don't know how to add the resource in my ServiceNow call...
Appreciate any ideas you might have.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2018 09:38 AM
HI,
Are you using proper credentials??
Thanks