Interface SecurityContext
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
SecurityContextImpl,TransientSecurityContext
Interface defining the minimum security information associated with the current thread
of execution.
The security context is stored in a SecurityContextHolder.
-
Method Summary
Modifier and TypeMethodDescriptionObtains the currently authenticated principal, or an authentication request token.voidsetAuthentication(Authentication authentication) Changes the currently authenticated principal, or removes the authentication information.
-
Method Details
-
getAuthentication
Authentication getAuthentication()Obtains the currently authenticated principal, or an authentication request token.- Returns:
- the
Authenticationornullif no authentication information is available
-
setAuthentication
Changes the currently authenticated principal, or removes the authentication information.- Parameters:
authentication- the newAuthenticationtoken, ornullif no further authentication information should be stored
-