@@ -32,8 +32,8 @@ public async Task<AccessToken> GenerateAsync(User user)
32
32
var secretKey = Encoding . UTF8 . GetBytes ( _siteSetting . JwtSettings . SecretKey ) ; // longer that 16 character
33
33
var signingCredentials = new SigningCredentials ( new SymmetricSecurityKey ( secretKey ) , SecurityAlgorithms . HmacSha256Signature ) ;
34
34
35
- var encryptionkey = Encoding . UTF8 . GetBytes ( _siteSetting . JwtSettings . EncryptKey ) ; //must be 16 character
36
- var encryptingCredentials = new EncryptingCredentials ( new SymmetricSecurityKey ( encryptionkey ) , SecurityAlgorithms . Aes128KW , SecurityAlgorithms . Aes128CbcHmacSha256 ) ;
35
+ var encryptionKey = Encoding . UTF8 . GetBytes ( _siteSetting . JwtSettings . EncryptKey ) ; //must be 16 character
36
+ var encryptingCredentials = new EncryptingCredentials ( new SymmetricSecurityKey ( encryptionKey ) , SecurityAlgorithms . Aes128KW , SecurityAlgorithms . Aes128CbcHmacSha256 ) ;
37
37
38
38
var claims = await GetClaimsAsync ( user ) ;
39
39
@@ -61,7 +61,7 @@ public async Task<AccessToken> GenerateAsync(User user)
61
61
public int ? ValidateJwtAccessTokenAsync ( string token )
62
62
{
63
63
var secretKey = Encoding . UTF8 . GetBytes ( _siteSetting . JwtSettings . SecretKey ) ; // longer that 16 character
64
- var encryptionkey = Encoding . UTF8 . GetBytes ( _siteSetting . JwtSettings . EncryptKey ) ; //must be 16 character
64
+ var encryptionKey = Encoding . UTF8 . GetBytes ( _siteSetting . JwtSettings . EncryptKey ) ; //must be 16 character
65
65
66
66
var tokenHandler = new JwtSecurityTokenHandler ( ) ;
67
67
try
@@ -70,7 +70,7 @@ public async Task<AccessToken> GenerateAsync(User user)
70
70
{
71
71
ValidateIssuerSigningKey = true ,
72
72
IssuerSigningKey = new SymmetricSecurityKey ( secretKey ) ,
73
- TokenDecryptionKey = new SymmetricSecurityKey ( encryptionkey ) ,
73
+ TokenDecryptionKey = new SymmetricSecurityKey ( encryptionKey ) ,
74
74
ValidateIssuer = false ,
75
75
ValidateAudience = false ,
76
76
// set clockskew to zero so tokens expire exactly at token expiration time (instead of 5 minutes later)
0 commit comments