使用 HS256 签署 Identity Server 4 令牌

Den*_*doo 1 identityserver4

我有一个现有的 api,它生成并使用 jwt 的标题,如下所示

{
  "typ": "JWT",
  "alg": "HS256"
}
Run Code Online (Sandbox Code Playgroud)

api使用JWT承载认证

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

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

lea*_*ege 5

IdentityServer 不支持对称密钥。