migrate to identity for authentication
All checks were successful
Build and Deploy API / build-and-deploy (push) Successful in 12s
All checks were successful
Build and Deploy API / build-and-deploy (push) Successful in 12s
This commit is contained in:
@@ -22,13 +22,17 @@ public class JwtService {
|
||||
|
||||
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
|
||||
if(user.UserName == null) return null;
|
||||
|
||||
// not too sure
|
||||
var claims = new[] {
|
||||
new Claim(ClaimTypes.Name, user.Name),
|
||||
new Claim(ClaimTypes.Name, user.UserName),
|
||||
new Claim(ClaimTypes.NameIdentifier, user.Id.ToString())
|
||||
};
|
||||
|
||||
var token = new JwtSecurityToken(
|
||||
issuer: "agologum",
|
||||
audience: "agologum",
|
||||
claims: claims,
|
||||
expires: DateTime.UtcNow.AddHours(2), // will add a refresher later
|
||||
signingCredentials: creds
|
||||
|
||||
Reference in New Issue
Block a user