Interface SecurityContext
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
SecurityContextImpl
,TransientSecurityContext
public interface SecurityContext extends java.io.Serializable
Interface defining the minimum security information associated with the current thread of execution.The security context is stored in a
SecurityContextHolder
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Authentication
getAuthentication()
Obtains the currently authenticated principal, or an authentication request token.void
setAuthentication(Authentication authentication)
Changes the currently authenticated principal, or removes the authentication information.
-
-
-
Method Detail
-
getAuthentication
Authentication getAuthentication()
Obtains the currently authenticated principal, or an authentication request token.- Returns:
- the
Authentication
ornull
if no authentication information is available
-
setAuthentication
void setAuthentication(Authentication authentication)
Changes the currently authenticated principal, or removes the authentication information.- Parameters:
authentication
- the newAuthentication
token, ornull
if no further authentication information should be stored
-
-