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