Updated JwtService.java
This commit is contained in:
@@ -42,18 +42,17 @@ public class JwtService {
|
|||||||
Date expiry = new Date(now.getTime() + EXPIRATION_MS);
|
Date expiry = new Date(now.getTime() + EXPIRATION_MS);
|
||||||
|
|
||||||
|
|
||||||
String email =azureJwt.getClaim("email");
|
String email = azureJwt.getClaim("email");
|
||||||
|
String username = email.split("@")[0];
|
||||||
|
|
||||||
return Jwts.builder()
|
return Jwts.builder()
|
||||||
.setSubject(email)
|
.setSubject(username)
|
||||||
.setIssuedAt(new Date())
|
.setIssuedAt(new Date())
|
||||||
.setExpiration(expiry)
|
.setExpiration(expiry)
|
||||||
.signWith(getSignKey(), SignatureAlgorithm.HS512)
|
.signWith(getSignKey(), SignatureAlgorithm.HS512)
|
||||||
//.signWith(SignatureAlgorithm.HS512, SECRET)
|
//.signWith(SignatureAlgorithm.HS512, SECRET)
|
||||||
.compact();
|
.compact();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String generateInternalTokenFromUsername(Authentication authentication) {
|
public String generateInternalTokenFromUsername(Authentication authentication) {
|
||||||
|
|||||||
Reference in New Issue
Block a user