-1

I am working on the share-point API via the OAuth 2.0, As Basic auth will be deprecating. So i am able to find the access token, however when passing the access token to the share-point API it is generating error with Status code 401 Unauthorized.

I have tried both the method i.e creating the API via the share-point and via AzureAD, however both of the API is generating the error even after passing the correct parameter's,

The share-point APP API is generating the error : {"error":"invalid_request","error_description":"Token type is not allowed."} with status code 401,

on the otherhand when creating the app via the AzureAD and granting all the access to the share-point app , I am getting the error : {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."} with the same status code 401.

for access token I am using the API : https://accounts.accesscontrol.windows.net/tenant-id/tokens/oauth/2

so what I need is the procedure to generate the access and refresh token and via that fetching the response of endpoint of share-point.

Error code while fetching response from share-point via sharepoint APP

enter image description here

Venkatesan
  • 3,748
  • 1
  • 3
  • 15

1 Answers1

0

thank's mate I had already performed the above mentioned steps, even pass the permission to the Share-point API of XML, I am able to get the access token, but when passing the token to share-point API, It is giving me below mentioned error => "error": {"code": "-2147024891, System.UnauthorizedAccessException"}

Is the reason I do made the app in AzureAD as it grant all the access to all office 365 product. And that app to is also throwing the error.

  • Id do perform the steps mention in link even grant all the permission to the share-point app via AzureAD. And now it is throwing me the error code: {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."} still not able to fetch the share-point API – amit vcrew Sep 09 '22 at 08:20
  • Many typos, not using stackoverflow's features – vilalabinot Sep 20 '22 at 19:52