Interface SecurityContext
- All Known Implementing Classes:
SecurityContextImpl
public interface SecurityContext
What the security layer knows about the thread's current request: who it is
from. Held by
SecurityContextHolder.-
Method Summary
Modifier and TypeMethodDescriptionThe authenticated principal, an anonymous token, or null when no chain has looked at the request.voidsetAuthentication(Authentication authentication) Changes who the request is from.
-
Method Details
-
getAuthentication
Authentication getAuthentication()The authenticated principal, an anonymous token, or null when no chain has looked at the request. -
setAuthentication
Changes who the request is from. Signing a user in by hand also needs the chain'sSecurityContextRepositoryto save it, or the next request starts anonymous again.
-