我有一个生产(普通)graph.microsoft.com应用程序正常运行。
当我尝试使用beta网址时,它在授权级别失败。当我引用测试端点https://graph.microsoft.com/beta/时,它的行为就好像我的应用注册不在我的租户中。
这就像我必须做一些特别的事情才能让我的应用注册工作在graph.microsoft.com的beta方面
这是一个应用程序 - 而不是委派用户。
//Works – Production
AuthenticationContext(https://login.microsoftonline.com/{MyTenantGuid}/v2.0)
ClientCredential({appIdGuid},{appSecret})
AuthenticationContext.AcquireTokenAsync(https://graph.microsoft.com/, ClientCredential)
//Fails – Beta
AuthenticationContext(https://login.microsoftonline.com/{MyTenantGuid}/v2.0)
ClientCredential({appIdGuid},{appSecret})
AuthenticationContext.AcquireTokenAsync(https://graph.microsoft.com/beta/, ClientCredential)
// solution... the above line should not have "beta" in it
在AcquireToken期间发生beta错误... 来自beta终点的实际错误文本是......
AADSTS50001:在名为{MyTenantGuid}的租户中找不到名为https://graph.microsoft.com/beta的应用程序
我只是想知道是否有一些特殊的东西可以访问测试版,因为我的正常https://graph.microsoft.com/v1.0/在令牌阶段期间按预期工作。
解决方案是...... BETA和常规v1.0对于令牌获取是相同的 您没有在beta令牌提取的资源中添加beta字样。 谢谢你标记你的答案
答案 0 :(得分:2)
/v1.0
和/beta
路径与Microsoft Graph API本身相关,而不是与身份验证服务相关。两个端点都使用相同的标记和范围集。
例如,如果您拨打https://graph.microsoft.com/v1.0/me
或https://graph.microsoft.com/beta/me
,相同的令牌就会有效。