【发布时间】:2024-01-16 23:22:01
【问题描述】:
我正在尝试从我的客户端应用程序调用经过身份验证的 API。但是,在制作 AcquireTokenAsync 时,我收到以下错误“authority_not_in_valid_list: 'authority' is not in the list of valid address”
这是我的代码 sn-p:
resourceUrl = "https://myApiEndPoint.com";
var clientCredential =
new ClientCredential( myClientAppId, myClientSecretKey );
// myClientAppId 和 myClientSecretKey 是来自 Azure 门户的值
var authContext =
new AuthenticationContext( "https://my_authority/myApiEndPoint");
return await authContext.AcquireTokenAsync( resourceUrl, clientCredential );
在我的应用程序客户端 ID 的 Azure 门户中,我已授予访问 https://myApiEndPOint.com api 的委派权限。
对可能导致此问题的原因以及不在有效列表中的含义有何想法?
【问题讨论】:
标签: azure authentication oauth active-directory access-token