Currently I'm using keycloak in my application that uses websocket. However, when I establish the websocket using atmosphere library in the frontend, I pass as a header the token after authentication. The token at that time is active and the connection gets establish without an issue.
However, if my token expires and I receive a refresh token, the websocket channel still holds the old token since I haven't refreshed my browser and hence I receive an error saying that the token is not active when I try to send a websocket message.
The only way I find to attach the new token is to actually re-establish the websocket connection and append the new token in the headers but that's not what I want to do.
Is there a way to keep the token updated into an ongoing websocket channel ?
This question has been a discussion in some topics but I couldn't extract a solution for this.
Thank you