public static async Task <JwtToken> GenerateJwt(this ClaimsIdentity identity, IJwtFactory jwtFactory, JwtIssuerOptions jwtOptions, long id)
        {
            var ret = new JwtToken()
            {
                Id        = id.ToString(),
                Token     = await jwtFactory.GenerateEncodedToken(id, identity),
                ExpiresIn = (int)jwtOptions.ValidFor.TotalSeconds
            };

            return(ret);
        }
Esempio n. 2
0
 public JwtFactory(IOptions <JwtIssuerOptions> jwtOptions)
 {
     _jwtOptions = jwtOptions.Value;
     ThrowIfInvalidOptions(_jwtOptions);
 }