Created
January 11, 2017 14:10
-
-
Save dmarko484/b3bd04485dcf32aa8dcab3d7e0051ff3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package app.config; | |
import org.springframework.context.ApplicationListener; | |
import org.springframework.security.authentication.event.InteractiveAuthenticationSuccessEvent; | |
import org.springframework.security.core.userdetails.UserDetails; | |
import org.springframework.stereotype.Component; | |
@Component | |
public class LoginListener implements ApplicationListener<InteractiveAuthenticationSuccessEvent> { | |
@Override | |
public void onApplicationEvent(InteractiveAuthenticationSuccessEvent event) | |
{ | |
UserDetails user = (UserDetails) event.getAuthentication().getPrincipal(); | |
System.out.println("LOGIN name: "+user.getUsername()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment