Package org.springframework.security.core.context

# Class TransientSecurityContext

java.lang.Object
org.springframework.security.core.context.SecurityContextImpl
org.springframework.security.core.context.TransientSecurityContext

All Implemented Interfaces:
  `Serializable`, `SecurityContext`

@Transient public class TransientSecurityContext extends SecurityContextImpl
A `SecurityContext` that is annotated with @`Transient` and thus should never be stored across requests. This is useful in situations where one might run as a different user for part of a request.

Since:
  5.7
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`TransientSecurityContext()`
`TransientSecurityContext(Authentication authentication)`

## Method Summary

### Methods inherited from class org.springframework.security.core.context.SecurityContextImpl

`equals, getAuthentication, hashCode, setAuthentication, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### TransientSecurityContext

public TransientSecurityContext()

### TransientSecurityContext

public TransientSecurityContext(Authentication authentication)