0

From my web api on trying to call the Sharepoint REST API I am requesting for an on-behalf of access token:

string[] sharepointScopes = { "https://tenantid.sharepoint.com/Files.ReadWrite.All", "https://tenantid.sharepoint.com/Sites.ReadWrite.All" };
AuthenticationResult result = null;
try
{
    result = await cca.AcquireTokenOnBehalfOfAsync(sharepointScopes, userAssertion, "https://login.microsoftonline.com/common/oauth2/v2.0");
}
catch (MsalServiceException e)
{
    if (e.Message.StartsWith("AADSTS50076"))
    {
        string responseMessage = String.Format("{{\"AADError\":\"AADSTS50076\",\"Claims\":{0}}}", e.Claims);
        return SendErrorToClient(HttpStatusCode.Forbidden, null, responseMessage);
    }

    if ((e.Message.StartsWith("AADSTS65001"))
        || (e.Message.StartsWith("AADSTS70011: The provided value for the input parameter 'scope' is not valid.")))
    {
        return SendErrorToClient(HttpStatusCode.Forbidden, e, null);
    }
    else
    {
        throw e;
    }                    
}

I am getting error AADSTS90124: Resource 'https://tenantid.sharepoint.com' (Office 365 SharePoint Online) is not supported over the /common or /consumers endpoints. Please use the /organizations or tenant-specific endpoint

  • What end point does the /LinkingUri refers to? – Ankit Katiyar Sep 13 '18 at 7:29
  • LinkingURI is a property of an Item in a Sharepoint List. If I copy and paste the URL in a browser (authenticated with Sharepoint) it returns a result – Codecrasher99 Sep 13 '18 at 8:33
  • As per the AAD documentation docs.microsoft.com/en-us/azure/active-directory/develop/… I need to specify a tenant guid for accessing a v1.0 endpoint and I was doing that so what am I missing now to be getting the AD error AADSTS90124 – Codecrasher99 Sep 13 '18 at 9:30
  • Can you please edit your question and post your code and the error to have a better understanding of it – Ankit Katiyar Sep 13 '18 at 9:33
0

OK the common endpoint (https://login.microsoftonline.com/common/oauth2/v2.0) was modified to the tenant endpoint and it worked

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.