spring-projects / spring-projects/spring-security

Classes implementing Authentication don't have anonymous attribute for additional data

Open
#4,224 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Summary

I ran into this problem when trying to setup Spring Boot microservices with Redis session. I want to add additional data to org.springframework.security.core.Authentication implementation or its getDetails() or getPrincipal(), like JSON containing userID, email and etc. but I cannot do that without implementing something of my own or storing data in HttpSession attributes. I'd like to avoid both of those ways, because then I need to add the implementation classes to other microservices or access the data from HttpSessionattributes and that somehow feels kind of dirty to me. Are there plans of adding addition attribute to any of the existing implementations, like String or Object get/setAdditionalData(), or I did not find them, or I should just store it in HttpSession attributes because it's a common way of doing what I want?

Version

spring-security-core 4.1.4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names org.springframework.security.core.Authentication and its getDetails() and getPrincipal() methods, but no files or tests. Start by reviewing those APIs and existing authentication implementations, then determine whether additional data belongs in the authentication contract or session attributes. Done requires a maintainer-approved scope and design.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.