azure-active-directory - 迁移到 .net5 后的 Blazor webassembly azure 广告身份验证问题
问题描述
迁移到 .net5 后的 Blazor webassembly azure 广告身份验证问题
错误:AADSTS28000:为输入参数范围提供的值无效,因为它包含多个资源。范围https://graph.microsoft.com/User.Read api://861be009-5e73-4c6c-a095-b6e193522222/API。访问 openid 配置文件无效。
范围代码(网络程序集):
builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
options.ProviderOptions.DefaultAccessTokenScopes.Add("https://graph.microsoft.com/User.Read");
options.ProviderOptions.DefaultAccessTokenScopes.Add("api://861be009-5e73-4c6c-a095-b6e193522222/API.Access");
解决方案
当您请求令牌时,您在范围内使用不同的资源端点,即 Microsoft Graph 和您的自定义 API,这是不正确的,您可以只为一种资源请求令牌,因为一个令牌只能有一个受众.
推荐阅读
- python - 不正确的输出 Project Euler #50
- vue.js - Vue - 添加的嵌套属性变得反应,但为什么?
- html - 在无序列表中应用不同的间距
- python - Pandas - 通过比较同一数据框中的其他列值(单词)来提取列中不匹配的句子单词
- c++ - 如何正确使用四元数进行旋转
- flask - 在 Kubernetes 入口上使用 Gunicorn 烧瓶会产生 502 nginx 错误
- ios - 获取 HeightForRowAt 中的行高
- javascript - Jest 覆盖率测试报告的准确性如何?Jest 测试覆盖率是如何计算的?我应该如何分析覆盖率调查结果?
- botframework - 网络聊天的企业机器人模板异常
- express - 为什么我的代理 docker 网络请求在本地工作而不是在生产中工作?