JWT token username update
This commit is contained in:
parent
564d80212a
commit
8cdb4aec20
@ -66,7 +66,7 @@ public class CustomAuthenticationProviderForCezen implements AuthenticationProvi
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new UsernamePasswordAuthenticationToken(user, pwd, authorities);
|
return new UsernamePasswordAuthenticationToken(user.getUserName(), pwd, authorities);
|
||||||
} else {
|
} else {
|
||||||
throw new BadCredentialsException("Invalid password!");
|
throw new BadCredentialsException("Invalid password!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class JWTTokenGeneratorFilter extends OncePerRequestFilter {
|
|||||||
|
|
||||||
//at this point the user is authenticated we just have to send the token back
|
//at this point the user is authenticated we just have to send the token back
|
||||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
System.out.println(authentication);
|
System.out.println(authentication.getName()+" Is the name ");
|
||||||
if (null != authentication) {
|
if (null != authentication) {
|
||||||
|
|
||||||
//get the JWT key from the contents we defined
|
//get the JWT key from the contents we defined
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user