fr.smallcrew.security.util.SessionUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smallcrew-security Show documentation
Show all versions of smallcrew-security Show documentation
Foundation of all smallcrew's projects needing authenticated users and role management
The newest version!
package fr.smallcrew.security.util;
import fr.smallcrew.security.domain.DomainUser;
import fr.smallcrew.security.web.AuthenticatedUser;
import org.springframework.security.core.context.SecurityContextHolder;
public class SessionUtils {
public static DomainUser getDomainUser() {
return ((AuthenticatedUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getUser();
}
}