0

I am trying to get SharePoint list and its items by REST API. Below is the approach I have done -

Create a App in SharePoint. Got the Client ID, Client Secret. Using the below URL I got the access token

https://accounts.accesscontrol.windows.net/{TenanatId}/tokens/OAuth/2

Now I am using the below URL to get List Items -

https://XXXXXX.sharepoint.com/sites/myname/_api/web/lists/getbytitle('mylistname')/items

Method - GET In Header I provided the below details Authorization : Bearer + Access Token Accept: application/json;odata=verbose

I am getting

401 Unauthoried - {"error":"invalid_request","error_description":"Token type is not allowed."}

Below permission i have given in the APP Permission XML

<AppPermissionRequests>
      <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl"/>
      <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl"/>
    </AppPermissionRequests>
0

Try to run the command set-spotenant -DisableCustomAppAuthentication $false.

Here is a similar issue for your reference:

SharePoint Online authorization issue 'Token type is not allowed'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.