
uk.co.caeldev.springsecuritymongo.services.SecurityContextService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-security-mongo Show documentation
Show all versions of spring-security-mongo Show documentation
A Commons Library to provide the repositories for mongo db
package uk.co.caeldev.springsecuritymongo.services;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
@Component
public class SecurityContextService {
public Authentication getAuthentication() {
return SecurityContextHolder.getContext().getAuthentication();
}
public void setAuthentication(final Authentication authentication) {
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy