public interface

SecurityContext

implements Serializable
org.springframework.security.core.context.SecurityContext
Known Indirect Subclasses

Class Overview

Interface defining the minimum security information associated with the current thread of execution.

The security context is stored in a SecurityContextHolder.

Summary

Public Methods
abstract Authentication getAuthentication()
Obtains the currently authenticated principal, or an authentication request token.
abstract void setAuthentication(Authentication authentication)
Changes the currently authenticated principal, or removes the authentication information.

Public Methods

public abstract Authentication getAuthentication ()

Obtains the currently authenticated principal, or an authentication request token.

Returns
  • the Authentication or null if no authentication information is available

public abstract void setAuthentication (Authentication authentication)

Changes the currently authenticated principal, or removes the authentication information.

Parameters
authentication the new Authentication token, or null if no further authentication information should be stored