Skip to content

SockJS client does not use HttpHeaders passed by WebSocketConnectionManager for ServerInfo request [SPR-13254] #17845

@spring-projects-issues

Description

@spring-projects-issues

Holger Schott opened SPR-13254 and commented

SockJSClient does a ServerInfo request to obtain capabilities supported by SockJS server. The websocket endpoint is secured with BASIC AUTH, thus i need to pass in valid credentials by adding HttpHeaders to the WebSocketConnectionManager.
When using raw rfc-6455 websockets the user gets authenticated and everything is fine.
But when using SockJS with RestTemplateXhrTransport and WebSocketTransport the user will not be authenticated while the SockJSClient does the ServerInfo request.
The HttpHeaders added to the WebSocketConnectionManager will not be used for the ServerInfo request.
As a workaround i can configure a RestTemplateXhrTransport as InfoReceiver and pass in the HttpHeaders there, but then i have to configure the authentication credentials twice. And thats not what i want.


Affects: 4.1.6

Referenced from: commits b7bdd72

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions