我正在从ADAL迁移到MSAL,然后在将令牌传递到我的api时得到未经授权的错误。(使用2.1和.NET核心( .NET核心2.1框架))
已经注册了redirecturl.
)
appsetting.json文件包含设置
AzureAd{
Authority: "https://login.microsoftonline.com/common",
ValidClientIds: ["Guid1","Guid2"],
"AllowedIssuers: ["stsurl1","stsurl2"]
}
Startup.cs代码
services.AddAuthentication(opt => {opt.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;}).AddAzureAdBearer(opt2 => configuration.Bind("AzureAd", opt2)); ```
发布于 2022-08-01 03:01:39
api://<clientId>
.So的内容,请尝试通过更改或包括clientId作为clientId和appId uri来检查,或者允许同时使用clientId作为clientId和appId uri,如果这不是这个问题,请尝试将在蔚蓝广告门户中显示的Web应用程序的accessTokenAcceptedVersion
属性更改为1或null,如果是2,则将其更改为2。admin consent
,或者从门户本身授予admin consent
,或者与管理员检查。https://stackoverflow.com/questions/73167190
复制相似问题