public JwtSecurityToken CreateJwtSecurityToken(tokenOptions tokenOptions, user user, SigningCredentials SigningCredentials, List <role> userRoles) { var jwt = new JwtSecurityToken( issuer: tokenOptions.Issuer, audience: tokenOptions.Audience, expires: DateTime.Now.AddMinutes(tokenOptions.accessTokenExpiration), notBefore: DateTime.Now, claims: setClaimsForUser(user, userRoles), signingCredentials: SigningCredentials ); return(jwt); }
public jwtHelper(IConfiguration configuration) { _configuration = configuration; _tokenOption = _configuration.GetSection("TokenOptions").Get <tokenOptions>(); }