如何";AcquireToken“;适用于Microsoft Graph和SharePoint Online

如何";AcquireToken“;适用于Microsoft Graph和SharePoint Online,sharepoint,microsoft-graph-api,Sharepoint,Microsoft Graph Api,我可以使用以下方法获取带有证书的Graph的有效令牌: AuthenticationResult authenticationResult = await context.AcquireTokenAsync(resource, certificate); 在哪里 resource = "https://graph.microsoft.com" 我可以通过以下方式对SharePoint Online执行同样的操作: resource = "https://{myAAD}.sharepoint.

我可以使用以下方法获取带有证书的Graph的有效令牌:

AuthenticationResult authenticationResult = await context.AcquireTokenAsync(resource, certificate);
在哪里

resource = "https://graph.microsoft.com"
我可以通过以下方式对SharePoint Online执行同样的操作:

resource = "https://{myAAD}.sharepoint.com"
我想对两者使用相同的令牌,因此我尝试:

resource = "https://{myAAD}.sharepoint.com;https://graph.microsoft.com";
它不起作用! 租户、客户机ID和证书对于这两个都是相同的 有办法吗?
提前感谢

访问令牌始终对单个资源有效,而不是对更多资源有效。 只需调用AcquireTokenAsync方法两次,一次用于图形,一次用于SharePoint