Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Retrieve User information in Spring Security

public interface IAuthenticationFacade {
    Authentication getAuthentication();
}
@Component
public class AuthenticationFacade implements IAuthenticationFacade {

    @Override
    public Authentication getAuthentication() {
        return SecurityContextHolder.getContext().getAuthentication();
    }
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #Retrieve #User #information #Spring #Security
ADD COMMENT
Topic
Name
2+5 =