I\'m using Spring Security 3 and Spring MVC 3.05.
I would like to print username of currently logged in user,how can I fetch UserDetails in my Controller?
You can use below code to find out principal (user email who logged in)
org.opensaml.saml2.core.impl.NameIDImpl principal = (NameIDImpl) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String email = principal.getValue();
This code is written on top of SAML.