hapijs / nes

WebSocket adapter plugin for hapi routes
Other
503 stars 87 forks source link

Using custom authentication strategies like in hapi #180

Closed chamini2 closed 7 years ago

chamini2 commented 7 years ago

I wanted to use a jwt strategy like we already do in Hapi, but found that setting

server.subscribe('/path', {
  auth: 'jwt'
});

does not work, how can I achieve this?

hueniverse commented 7 years ago

You still protect the actual endpoint with JWT, but you use one of the options nes supports for the protocol level. nes uses its own method to authenticate you to the nes websocket connection, and from there it uses normal auth. Just look at the tests for examples.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.