我完全按照这个链接https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=aadv1%2Ccsharp%2Cbot-oauth和为我的 Web 应用程序机器人创建了 Azure AD 应用程序注册并使用 Azure Active Directory v1。
登录后,我查看了令牌,但使用该令牌我无法访问 Azure API,因为它在 Postman 中显示以下响应:
{
"error": {
"code": "AuthenticationFailed",
"message": "Authentication failed."
}
我在下面调用了 Azure API:
https://management.azure.com/subscriptions/${subscriptionId}/providers/Microsoft.Consumption/usageDetailsapi-version=2018-10-01
在我在 Azure AD 中注册的应用程序中,我已授予以下访问 Azure API 的权限:
在我的 Web App Bot -> 设置 -> OAuth 连接设置中,我选择:
ClientId -> My application client id
ClinetSecret -> My application client secret
GrantType -> I does not know what to give so I just typed "authorization_code" (If this wrong then Where I need to find my grantType)
LoginURL -> https://login.microsoftonline.com
TenantId -> common (To allow any user)
ResourceURL -> https://graph.microsoft.com/
Scopes -> I just left blank
为什么我无法使用该令牌访问 Azure API?
任何帮助。谢谢

