使用HS256签名Identity Server 4令牌

时间:2019-03-27 13:20:57

标签: identityserver4

我有一个现有的api,它会生成并使用jwt,其头信息如下所示

{
  "typ": "JWT",
  "alg": "HS256"
}

api使用JWT承载身份验证

app.UseJwtBearerAuthentication(new JwtBearerAuthenticationOptions
{
    AuthenticationMode = AuthenticationMode.Active,
    AllowedAudiences = new[] { "Any" },
    IssuerSecurityTokenProviders = new IIssuerSecurityTokenProvider[]
    {
        new SymmetricKeyIssuerSecurityTokenProvider(issuer, secret)
    }
});

我现在想将身份服务器用于要与其集成的客户端。 如何使Identity Server以现有api期望的方式对令牌进行签名(HS256)。

1 个答案:

答案 0 :(得分:1)

IdentityServer不支持对称密钥。

相关问题