public async Task <LoginResponse> GenerateJwt(ClaimsIdentity identity, IJwtFactory jwtFactory, string userName, JwtIssuerOptions jwtOptions)
        {
            var response = new LoginResponse
            {
                Id         = identity.Claims.Single(c => c.Type == "id").Value,
                Auth_Token = await jwtFactory.GenerateEncodedToken(userName, identity),
                Expires    = (int)jwtOptions.ValidFor.TotalSeconds
            };

            return(response);
        }
 public JwtFactory(IOptions <JwtIssuerOptions> jwtOptions)
 {
     _jwtOptions = jwtOptions.Value;
     ThrowIfInvalidOptions(_jwtOptions);
 }