【发布时间】:2017-10-23 13:09:03
【问题描述】:
我有一个使用 Owin 和 Identity Server 4 进行身份验证的 .net 表单客户端,但我没有收到额外的声明 HttpContext.Current.GetOwinContext().Authentication.User。我做错了什么?
我正在 IDS4 上的 accountController 中添加额外的声明,如下所示:
await HttpContext.Authentication.SignInAsync(user.SubjectId, user.Username, props, additionalClaims.ToArray());
在我的客户端上:
if (!Request.IsAuthenticated)
{
HttpContext.Current.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties
{
RedirectUri = "/Default1.aspx",
},
OpenIdConnectAuthenticationDefaults.AuthenticationType);
}
else
{
foreach (var claim in HttpContext.Current.GetOwinContext().Authentication.User.Claims)
【问题讨论】:
标签: c# owin openid-connect identityserver4 claims