我有一个链接到 Azure AD 的 Azure 应用服务/Web API 并且身份验证正在工作,但是客户端令牌将在 1 小时后过期,所以我想启用 OAuth refresh_token。当我检查在我的服务上调用 /.auth/me 的结果时,我没有看到 refresh_token。应用服务上启用了令牌存储。
我尝试将其添加到oauth2permissions
Azure AD 清单中,如下所示,但它没有出现(我已重新启动 App 服务并重新部署我的服务以防缓存令牌):
"oauth2Permissions": [
{
"adminConsentDescription": "Allow the application to store a refresh token on behalf of the signed-in user.",
"adminConsentDisplayName": "Refresh tokens",
"id": "3AGH4D29-B64A-4A9A-8DBC-5DB3C8BBBD75",
"isEnabled": true,
"type": "User",
"userConsentDescription": "Allow the application to store a refresh token on your behalf.",
"userConsentDisplayName": "Store refresh token",
"value": "refresh_token"
}
]
我的尝试基于此处给出的指导: https ://cgillum.tech/2016/03/07/app-service-token-store/