diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java index b6c7677..f7edc02 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java @@ -66,7 +66,7 @@ public class CustomAuthenticationProviderForCezen implements AuthenticationProvi return null; } - return new UsernamePasswordAuthenticationToken(user, pwd, authorities); + return new UsernamePasswordAuthenticationToken(user.getUserName(), pwd, authorities); } else { throw new BadCredentialsException("Invalid password!"); } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java index d2b5838..6fe5da3 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java @@ -27,7 +27,7 @@ public class JWTTokenGeneratorFilter extends OncePerRequestFilter { //at this point the user is authenticated we just have to send the token back Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - System.out.println(authentication); + System.out.println(authentication.getName()+" Is the name "); if (null != authentication) { //get the JWT key from the contents we defined