身份声明中的 IdentityServer 偏移量
IdentityServer offset in identity claim
给定
身份服务器允许 RessourceOwner 和混合流。
混合流程集成在网站中,RessourceOwner 流程由 api.
使用
当我使用混合流登录时,我可以看到有一个主题声明,其中包含主题/ID 数据。
当我使用 ressourceowner 进行身份验证时,我可以在 claimsprincipal 中看到在
中设置了 id
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier
哪里有偏移量?这是否表明我错误编码了某些内容?或者这是预期的行为,如果是,为什么?
-- 更新
配置在api
app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = identServer
});
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"
}
};
原因是我没有清除默认映射..
它是教程的一部分,但从未解释为什么...
JwtSecurityTokenHandler.InboundClaimTypeMap.Clear();
给定
身份服务器允许 RessourceOwner 和混合流。 混合流程集成在网站中,RessourceOwner 流程由 api.
使用当我使用混合流登录时,我可以看到有一个主题声明,其中包含主题/ID 数据。
当我使用 ressourceowner 进行身份验证时,我可以在 claimsprincipal 中看到在
中设置了 idhttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier
哪里有偏移量?这是否表明我错误编码了某些内容?或者这是预期的行为,如果是,为什么?
-- 更新
配置在api
app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = identServer
});
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"
}
};
原因是我没有清除默认映射.. 它是教程的一部分,但从未解释为什么...
JwtSecurityTokenHandler.InboundClaimTypeMap.Clear();