spring-projects / spring-projects/spring-security

Documentation on Authentication and JPA

Open
#14,385 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: docs type: enhancement
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Expected Behavior
Quick Note about JPA Caching Interactions with the Authentication Chain

Current Behavior
Nothing currently noting the interaction with the EntityManager when using defaults.

Context (This is mostly Conjecture, based on Stack Traces and a lot of break point, but the Current Behavior is currect)
As the Spring Security Filter Chain is typically one of the first filters, the OpenEntityManagerInViewFilter/OpenEntityInViewInterceptor Filters are not called yet. This means if your UserDetailsService is JPA based, any DB Entity will not be associated to the JPA Persistence Context for the rest of the request. Although this behavior is preferred, it would be good to document that the Entity is unmanaged when using defaults.

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

Review the Spring Security Filter Chain, UserDetailsService, EntityManager, OpenEntityManagerInViewFilter, and OpenEntityInViewInterceptor mentioned in the issue. Verify the described default behavior before updating the relevant authentication documentation, and consider the work complete when the Entity's managed or unmanaged state and its interaction with JPA are accurately explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, backend, database, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.