{"action":"closed","issue":{"url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/320","labels_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/320/comments","events_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/320/events","html_url":"https://github.com/ratchetphp/Ratchet/issues/320","id":84045607,"number":320,"title":"Authentication in Ratchet Webocket server","user":{"login":"travisspears0","id":4980350,"avatar_url":"https://avatars.githubusercontent.com/u/4980350?v=3","gravatar_id":"","url":"https://api.github.com/users/travisspears0","html_url":"https://github.com/travisspears0","followers_url":"https://api.github.com/users/travisspears0/followers","following_url":"https://api.github.com/users/travisspears0/following{/other_user}","gists_url":"https://api.github.com/users/travisspears0/gists{/gist_id}","starred_url":"https://api.github.com/users/travisspears0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisspears0/subscriptions","organizations_url":"https://api.github.com/users/travisspears0/orgs","repos_url":"https://api.github.com/users/travisspears0/repos","events_url":"https://api.github.com/users/travisspears0/events{/privacy}","received_events_url":"https://api.github.com/users/travisspears0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ratchetphp/Ratchet/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-02T14:21:06Z","updated_at":"2015-08-20T19:21:19Z","closed_at":"2015-08-20T19:21:19Z","body":"Hi! I want to do an authentication on Ratchet Webocket server. I've came to the idea to pass username and password in url(when connecting via js websocket client) and then perform standard login uing PDO. I would like to do an authentication and then send a mesage to user whether it was successful, and if not, close the connection. I'm not sure how to do thi as there are no such issues on the web and in the documentation either. I tried to do this in the SocketServer class(copied from tutorial and modified by me, implements Ratchet\\MessageComponentInterface) but I can't figure out how to force closing connection there. So theres quetion number one how to do such thing? I also tried to do this in Guzzle\\Http\\Message\\Request as there's a method named setAuth but I have no clue how to use it. Please help."}}