Skip to content

Annotate Authentication classes as transient #5481

@jzheaux

Description

@jzheaux

Spring Security can be configured as STATELESS, which prevents Authentication tokens from being persisted across the board.

Introducing an annotation would make so that specific Authentication types could be considered stateless without needing to mark the entire application as stateless:

@TransientAuthentication
public class MyTransientAuthenticationToken implements Authentication {
    // ...
}

With the above marker, HttpSessionSecurityContextRepository would ignore this token instead of storing it in the session.

Ensure that this annotation works as a meta-annotation as well as an inherited annotation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions