Announcement Announcement Module
Collapse
No announcement yet.
security tag can not work after autologin Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • security tag can not work after autologin

    I add some code for autologin after register. this is the code

    UserDetails userDetails = userDetailsService.loadUserByUsername(username);
    Authentication authentication = new PrincipalSpringSecurityUserToken(username,
    username, userDetails.getPassword(), userDetails.getAuthorities(), userDetails);

    // Place the new Authentication object in the security context.
    SecurityContextHolder.getContext().setAuthenticati on(authentication);

    I use security tag to show username after login. but username do not appear. who can tell me, what wrong.
    thanks in advances
Working...
X