spring-projects / spring-projects/spring-security
SEC-2902: "Missing" class: obtain pre-auth roles from request headers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Jeff Jensen (Migrated from SEC-2902) said:
I recently configured pre-auth with request headers only for both user id and roles. I did not find an example of this situation and all examples I found either did not load roles or roles were not loaded from request headers.
While Spring has a generic class for obtaining the user id from headers, I also did not find a generic class for obtaining the roles from headers.
Attached is a simple generic class for obtaining roles from request headers that Spring should have to complete the pair: PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetailsSource
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Spring's existing generic class for obtaining the user ID from request headers and the referenced PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetailsSource class. Confirm how pre-authenticated roles should be obtained from headers, then provide a generic roles source and an example showing the user ID and roles configured together.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, authorization, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100