Just cleanup
This commit is contained in:
@@ -9,20 +9,18 @@ public static class JwtTokenHelper
|
||||
{
|
||||
public static string GenerateJwtToken(string issuer, string audience, string key, string userId)
|
||||
{
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(JwtRegisteredClaimNames.Sub, userId),
|
||||
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||
new Claim(ClaimTypes.NameIdentifier, userId)
|
||||
};
|
||||
|
||||
var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));
|
||||
var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);
|
||||
|
||||
var token = new JwtSecurityToken(
|
||||
issuer: issuer,
|
||||
audience: audience,
|
||||
claims: claims,
|
||||
claims: new[]
|
||||
{
|
||||
new Claim(JwtRegisteredClaimNames.Sub, userId),
|
||||
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||
new Claim(ClaimTypes.NameIdentifier, userId)
|
||||
},
|
||||
expires: DateTime.Now.AddMinutes(30),
|
||||
signingCredentials: credentials);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user