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
/LinkingUri
refers to?