小编Den*_*doo的帖子

使用 HS256 签署 Identity Server 4 令牌

我有一个现有的 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)对令牌进行签名。

identityserver4

1
推荐指数
1
解决办法
367
查看次数

标签 统计

identityserver4 ×1