【发布时间】:2020-11-28 11:58:16
【问题描述】:
我创建了一个具有个人帐户安全性的 asp.net 核心 Web 应用程序,并将其配置为用于外部 spa 的授权/身份验证,我在 appset5tings.json 文件中添加了以下配置
{
"ConnectionStrings":
{
"DefaultConnection":
"Server=localhost;Database=itrSts;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"IdentityServer": {
"Clients": {
"itr.childcare.webapp": {
"Profile": "SPA",
"RedirectUri": "http://localhost:3000/signin-callback",
"LogoutUri": "http://localhost:3000/signout-callback",
"AccessTokenLifetime": 600,
"Scopes": "openid profile gateway-api roles"
},
"Itr.Sts": {
"Profile": "IdentityServerSPA"
}
}
"Resources": {
"gateway-api": {
"Profile": "API",
"UserClaims": [
"role"
]
}
}
} }
当请求“openid profile gateway-api”范围时它工作正常但是当还请求角色范围时我得到无效范围错误谁能帮助我并告诉我应该做什么?谢谢
【问题讨论】:
标签: asp.net-core identityserver4 claims-based-identity