SockJsClient authentication headers
See original GitHub issueHello, I have question about authentication header adding while subscribing to server.
I am trying to do it like this:
<SockJsClient url={ wsSourceUrl } topics={[this.state.channelId]} headers={"Authorization: `Bearer ${this.token}`"}
onMessage={ this.onMessageReceive } ref={ (client) => { this.clientRef = client }}
onConnect={ () => { this.setState({ clientConnected: true }) } }
onDisconnect={ () => { this.setState({ clientConnected: false }) } }
debug={ false }/>
But Header isn’t getting set. What I am doing wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Providing auth header with SockJS - Stack Overflow
I'm using JWT to authenticate requests coming from the client. When the user logs in I'm returning an X-AUTH-TOKEN header, containing the JWT ......
Read more >SockJsClient
Set it if you want only a subset of handshake headers (e.g. auth headers) to be used for other HTTP requests. Parameters: httpHeaderNames...
Read more >Accessing header in STOMP web socket connection ... - Medium
Hi, I am currently working at https://mealpha.com as spring boot developer and working on a chat application using spring web sockets.
Read more >26. WebSocket Support - Spring
Instead of using cookies they may prefer to authenticate with headers at the STOMP messaging protocol level There are 2 simple steps to...
Read more >Authenticated websocket connection with Spring Boot and ...
getNativeHeader(WebSocketHttpHeaders.AUTHORIZATION)) .orElse(Collections.emptyList()); // if header does not exists returns null instead ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lahsivjar, it was problem in my CORS configuration. Thank you for your patience 😃 Headers works well.
@Prasad-YS How did your solve it? I have the exact same problem, headers don’t even show up on the request.