2016-10-03 44 views
1

鉴于IdentityServer在身份声明中的偏移量

Identity Server允许RessourceOwner和Hybrid流。 混合流被集成到网站中,并且ass使用RessourceOwner流。

当我与混合流登录,我可以看到,有一个受试者权利要求,包含主题/ ID数据。

当我与ressourceowner验证我可以在claimsprincipal看到该ID在

http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier 

组,其中有一个偏移?这是否表示我误解了某些内容?或者这是一种预期的行为,如果是的话,为什么?

- 更新

配置在API

app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions 
      { 
       Authority = identServer 
      }); 

外部Auth配置在IdentityServer

var fb = new FacebookAuthenticationOptions 
      { 
       AuthenticationType = "Facebook", 
       Caption = "Facebook", 
       SignInAsAuthenticationType = signInAsType, 
       AppId = "43543534543534534", 
       AppSecret = "sad345345345345354" 
      }; 
      app.UseFacebookAuthentication(fb); 

客户端配置在identityServer

return new Client 
      { 
       Enabled = true, 
       ClientId = "pluto", 
       ClientName = "Pluto Site", 
       ClientSecrets = new List<Secret> 
       { 
        new Secret("foo".Sha256()) 
       }, 
       Flow = Flows.ResourceOwner, 
       AllowedScopes = new List<string> 
       { 
        Constants.StandardScopes.OpenId, 
        "read" 
       } 
      }; 
+1

听起来像一个JWT处理程序配置的问题给我。 https://leastprivilege.com/2016/08/21/why-does-my-a-uthorize-attribute-not-work/ – leastprivilege

+0

对不起,看不到关于OpenIdConnectOptions链接的帖子,但目前我只有拥有IdentityServerBearerTokenAuthenticationOptions。我错过了什么吗?我还将配置代码添加到了我的初始文章中。 –

+0

我还尝试在api配置中设置NameClaimType =“subject”,但没有任何更改 –

回答

0

的REAS上是我失踪了清算的默认映射.. 这是在教程的一部分,但从来没有explaind为什么...

JwtSecurityTokenHandler.InboundClaimTypeMap.Clear();