2017-07-29 73 views

回答

1

我用Symfony Silex,RatchetPHP和OAuth2完成了它。

我首先從Silex RestApi獲取OAuth訪問令牌。

然後,當我打開連接時,我將它傳遞給棘輪websocket服務器,即websocket.connect('ws://localhost:8482?access_token=L83pR5amKt')

我可以用Ratchet檢索它,最後我知道哪個用戶在websocket連接後被認證。

+0

另外,我在砂岩中使用了這個技巧。您可能會對此感興趣,因此以下是身份驗證文檔:https://eole-io.github.io/sandstone/authentication.html – Alcalyn