2016-10-03 41 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();