Forum Discussion

vicenteoliveirau4's avatar
vicenteoliveirau4
Copper Contributor
Oct 27, 2021

Getting OAuth (client_credentials for M2M flow) to make HTTP request to SharePoint REST API

Hi all,

 

I'm working on an integration that will be making CRUD HTTP requests to a SharePoint online instance (I have a Microsoft 365 developer subscription). Before developing the integration I'm testing with Postman on how to get the OAuth token and making a trial request to be sure that authorization is working.

To get the OAuth token I've followed the instructions (are there any Microsoft 'official' guidelines on how to do this?) from http://pratapreddypilaka.blogspot.com/2018/05/sharepoint-online-authentication-for.html and I manage to get an OAuth token.

When I try to use the token I got in Postman to make a simple test HTTP request (https://xxxxxx.sharepoint.com/onesite/_api/web?$select=Title) I get a 401 error with the following message {"error":"invalid_request","error_description":"Token type is not allowed."}

Can someone provide some guidance on how to get 'the right' token to interact with SharePoint REST API?

 

Thanks in advance

Vicente

No RepliesBe the first to reply

Resources