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 Type
    Method
    Description
    The authenticated principal, an anonymous token, or null when no chain has looked at the request.
    void
    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

      void setAuthentication(Authentication authentication)
      Changes who the request is from. Signing a user in by hand also needs the chain's SecurityContextRepository to save it, or the next request starts anonymous again.