spring-projects / spring-projects/spring-session

Spring-Session-Hazelcast Question: How to change attributes of logged-in user in the session

Open
#1,090 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Hey everyone,

We are using spring-session-hazelcast (2.0.4.BUILD-SNAPSHOT) for session replication in our app cluster.
Now We have the following use case:

In our Session User (We created our own Class extending org.springframework.security.core.userdetails.User) we store different informations about our user.
Now this information can change. With spring-session-mongodb it was enough to get our user over the SecurityContextHolder.getAuthentication().getPrincipal() and set the changed attributes. But in HazelcastSessionRepository there is only a delta of the HazelcastSession saved. But the delta map is always empty.

So my question is: how can I force HazelcastSessionRepository to save my changes without need to relogin my user?

Thanks in advance

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

Start by tracing HazelcastSessionRepository's delta handling and compare it with the described SecurityContextHolder and spring-session-mongodb behavior. Determine how changes to the logged-in user's principal are detected and persisted without relogin; the issue does not mention a specific source file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.