WebSocket客户端身份验证方法

如何验证连接到Websocket服务器的客户端?</ strong> </ p>

在http中,我们也可以使用Oauth 2.0对用户和客户端进行身份验证。 但是在websocket中,我无法理解该怎么做。</ p>

据我了解,对于连接用户的身份验证,我们只需要让客户端发送带有令牌的消息即可 验证用户身份。 但是如何阻止身份不明的客户端连接到服务器?</ p>

没有用于Websocket的基于令牌的身份验证头</ strong>,因为这样做可以 就像在任何Oauth 2.0 Rest api身份验证中一样,同时进行两种身份验证。 </ p>
</ div>

展开原文

原文

How to authenticate the client connecting to the websocket server?

In http we could use Oauth 2.0 to authenticate the user and the client too. But in websocket I am not able to understand how to do so.

As far as I can understand for authentication of the user connecting we could just ask the client to send a message with a token to authenticate the user. But how to prevent an un-identified client to connect to the server?

Isn't there any header for token based authentication for websocket as that would allow for both the authentication simultaneously just as in any Oauth 2.0 Rest api authentication.

dragon188199
dragon188199 检查stackoverflow.com/questions/10332182/…
大约 6 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐