"Token type is not allowed" error on sharepoint search API

Copper Contributor
Aim:- To access sharepoint through REST Api
 
Steps taken:- 
 
  1. Created site on sharepoint.
  2. Registered site as an app using https://<<domain>>/sites/<<site name>>/_layouts/15/appregnew.aspx
  3. Granted tenant scope permission using https://<<domain>>/sites/<<site name>>/_layouts/15/appinv.aspx
  4. Permission xml used
  5. <AppPermissionRequests AllowAppOnlyPolicy="true">
      <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    </AppPermissionRequests>
          Headers
          Content-Type:application/json;odata=verbose
          Accept:application/json;odata=verbose
          Authorization:Bearer <<access token from step 5>>
 
         Got below error message
          {"error":"invalid_request","error_description":"Token type is not allowed."}
3 Replies

@Michal Machniak 

 

That solution does not work for me. I get the following error on the last statement:

 

>Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential set-spotenant -DisableCustomAppAuthentication $false


Connect-SPOService : A parameter cannot be found that matches parameter name 'DisableCustomAppAuthentication'.
At line:1 char:105
+ ... $userCredential set-spotenant -DisableCustomAppAuthentication $false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Connect-SPOService], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService