Last active
June 18, 2019 14:57
-
-
Save nest-don/2973188917141b0d943753662f5cb866 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["JwtKey"])); | |
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); | |
var expires = DateTime.Now.AddHours(Convert.ToDouble(_configuration["JwtExpireHours"])); | |
var token = new JwtSecurityToken( | |
_configuration["JwtIssuer"], | |
_configuration["JwtIssuer"], | |
claims, | |
expires: expires, | |
signingCredentials: creds | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment