Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token Authorization #9

Closed
aaa70 opened this issue Sep 7, 2015 · 6 comments
Closed

Token Authorization #9

aaa70 opened this issue Sep 7, 2015 · 6 comments

Comments

@aaa70
Copy link
Contributor

aaa70 commented Sep 7, 2015

Hi there,

Thank you for the awesome pod!

I'm building a chat app using this, but I want to check user authentication when socket joining.
It's related phoenixframework/phoenix#699 .

Do you have a plan to pass not only Phoenix.Message but something?

Best,

@davidstump
Copy link
Owner

That's definitely something to look into. I will have to read up on the decisions from that Phoenix thread.

Thanks for the suggestion!

@aaa70
Copy link
Contributor Author

aaa70 commented Sep 8, 2015

Hi @davidstump,

Thank you for your positive reply.
I'm looking forward to your update!
If I can help your work, I'll raise PR something.

Thanks,

@chrismccord
Copy link

This is pretty simple. Socket.connect needs to accept a dictionary and convert it to query string params to pass up with the websocket upgrade path. That's it!

@mudphone
Copy link
Contributor

mudphone commented Oct 1, 2015

Just jotting down some notes here, regarding @chrismccord 's comments, and a brief discussion about it today.

The deps/phoenix/web/static/js/phoenix.js comments mention the use of the params passed in the JS client, in this style:

//     let socket = new Socket("/ws", {params: {userToken: "123"}})
//     socket.connect()

Then it uses the static serialize() method to turn the params object into a query string. We should be able to do this in the SwiftPhoenixClient.

davidstump added a commit that referenced this issue Jan 19, 2016
Support token authentication #9
@davidstump
Copy link
Owner

Could you let me know if this got resolved with your PR? #17

@tony612
Copy link

tony612 commented Jul 4, 2016

@davidstump I think that PR is not enough. The params should be passed to server when the socket connection is built.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants