sibartlett / hapi-io

Awesome socket.io plugin for hapi
MIT License
105 stars 18 forks source link

hapi-auth-jwt #7

Open ghost opened 9 years ago

ghost commented 9 years ago

Hello @sibartlett

I'm trying to authenticate via hapi-auth-jwt2 strategy, with no success. By now, to authenticate connections I'm telling hapi-auth-jwt2 where to find the token :

https://github.com/dwyl/hapi-auth-jwt2/issues/57

But I feel that this could be quite redundant, because hapi.io could handle it... I'm completely missing the way to accomplish this...

`var socket = io('', {query : "Authorization=" + token}); // Authorization to make it consistent with hapi-auth-jwt2

Thank you!

EDIT:

O.K. I think that I've had a wrong presumption... that hapi-io could place authorization query on request's header...

sibartlett commented 9 years ago

Can you try the latest version of hapi-io?

I've fixed the parsing of query params, and now also automatically map "Authorization" query/data attributes to a header.

ghost commented 9 years ago

It works perfectly!!! Thank you so much !