Guest User

Untitled

a guest
Oct 8th, 2025
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1.     private void saveSecurityContext(HttpServletResponse httpResponse,
  2.                                      HttpServletRequest httpRequest,
  3.                                      Authentication authenticationResponse) {
  4.         SecurityContext securityContext = new SecurityContextImpl(authenticationResponse);
  5.         SecurityContextHolder.setContext(securityContext);
  6.         this.securityContextRepository.saveContext(securityContext, httpRequest, httpResponse);
  7.     }
  8.  
  9.     private Authentication authenticateUser(String username, String password) {
  10.         UserDetails userDetails = applicationUserDetailsService.loadUserByUsername(username);
  11.         Authentication authentication = new UsernamePasswordAuthenticationToken(userDetails, password);
  12.         return this.authenticationManager.authenticate(authentication);
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment