/// <summary> /// 初始化一个<see cref="JsonWebTokenAuthorizationHandler"/>类型的实例 /// </summary> /// <param name="options">Jwt选项配置</param> /// <param name="tokenValidator">Jwt令牌校验器</param> /// <param name="tokenStore">Jwt令牌存储器</param> public JsonWebTokenAuthorizationHandler( IOptions <JwtOptions> options , IJsonWebTokenValidator tokenValidator , IJsonWebTokenStore tokenStore) { _options = options.Value; _tokenValidator = tokenValidator; _tokenStore = tokenStore; }
public JsonWebTokenBuilder(IJsonWebTokenStore tokenStore , IOptions <JwtOptions> options) { _tokenStore = tokenStore; _options = options.Value; if (_tokenHandler == null) { _tokenHandler = new JwtSecurityTokenHandler(); } }
/// <summary> /// 初始化一个<see cref="JsonWebTokenAuthorizationHandler"/>类型的实例 /// </summary> /// <param name="options">Jwt选项配置</param> /// <param name="tokenValidator">Jwt令牌校验器</param> /// <param name="tokenStore">Jwt令牌存储器</param> public JsonWebTokenAuthorizationHandler( IHttpContextAccessor accessor, IOptions <JwtOptions> options , IJsonWebTokenValidator tokenValidator , IJsonWebTokenStore tokenStore , IAuthenticationSchemeProvider schemes) { _accessor = accessor; _options = options.Value; _tokenValidator = tokenValidator; _tokenStore = tokenStore; _schemes = schemes; }