spring-projects / spring-projects/spring-security

SEC-3006: Allow programmatically login using STOMP messaging

Open
#3,217 18 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Alex (Migrated from SEC-3006) said:

Currently it's not possible to authenticate a user inside a @MessageMapping method.

I suppose the problem is that if in the body of the method we manually call SimpMessageHeaderAccessor.setUser(...) then the user destination changes and he stops receiving messages sent to the queues it was subscribed to.

If there are no workaround for this, a clean solution would be welcome.

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 authentication inside @MessageMapping methods and reviewing how SimpMessageHeaderAccessor.setUser(...) affects user destinations and existing queue subscriptions. The work is done when a user can authenticate programmatically through STOMP without losing messages from queues they subscribed to.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.