Websocket, Angular 2 and JSON Web token Authentication

后端 未结 3 2117
死守一世寂寞
死守一世寂寞 2021-01-31 18:58

My Angular 2 app (coded in typescript) has a simple authentication scheme:

  • User logs in:
  • Server returns JSON Web Token (JWT) abc123...
  • <
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-31 19:18

    Client opens the websocket, sending the UserName and Password in query param

    ws://:@
    

    Example: new $WebSocket('ws://user:123456@127.0.0.0/util')

提交回复
热议问题