I'm using Play Framework with Scala to build a RESTful API. To implement authentication I'm using the play-silhouette
plugin, with the use of a BearerTokenAuthenticator
. It works perfectly.
The problem is that I must implement a service that use a WebSocket to push real-time updates, but I can't manage to setup user authentication for this method.
Silhouette provides support to do that (doc), the problem is that I can't find a way to put the token in the header of the websocket handshake requests. I did a lot of research, but without any result.
I thought that I could pass the token in the query string, instead of passing it in the request header.
My question is, how can I validate a token manually with silhouette?