【发布时间】:2018-04-09 14:47:46
【问题描述】:
如何在身份服务器 4/身份验证代码流中为访问令牌 jwt 请求额外声明?在我的身份验证代码流登录期间,我的自定义配置文件服务始终显示 RequestedClaimTypes 为 0,因此生成的访问令牌 jwt 具有我的主题声明,但没有名字、姓氏或电子邮件声明。
这是我从客户那里请求的范围: "TestApi openid 个人资料电子邮件"
这是我在身份服务器上的客户端定义:
new Client {
ClientId = "authorizationCodeClient2",
ClientName = "Authorization Code Test",
ClientSecrets = {
new Secret("secret".Sha256())
},
Enabled = true,
AllowedGrantTypes = GrantTypes.Code,
RequireConsent = true,
AllowRememberConsent = false,
RedirectUris =
new List<string> {
"http://localhost:5436/account/oAuth2"
},
AllowedScopes = { "TestApi", "openid", "profile", "email" },
AccessTokenType = AccessTokenType.Jwt
}
将https://github.com/bayardw/IdentityServer4.Authorization.Code 用于测试客户端。
【问题讨论】:
标签: identityserver4