【发布时间】:2017-01-03 10:39:05
【问题描述】:
以前,我可以使用JwtBearerAuthenticationOptions 来添加我的自定义令牌处理程序和我的自定义验证。现在有了核心UseJwtBearerAuthentication,我需要使用JwtBearerOptions,它似乎没有覆盖JwtSecurityTokenHandler的选项。我基本上想覆盖JwtSecurityTokenHandler中的以下方法:
protected virtual JwtSecurityToken ValidateSignature(string token, TokenValidationParameters validationParameters)
以前:
app.UseJwtBearerAuthentication(new JwtBearerAuthenticationOptions
{
TokenHandler = new MyTokenHandler()
// other properties here
});
目前使用 ASP.NET Core:
app.UseJwtBearerAuthentication(new JwtBearerOptions
{
// other properties here
});
【问题讨论】:
标签: c# authentication asp.net-core jwt openid-connect