Reputation: 473
I want to implement identityserver3 Authentication & Authorization on MVC. And i'm using web sockets on MVC app. I have a self-hosted-web-socket-server (SHWSS). My client side web sockets communicate with my SHWSS. After successful login on identityserver how can I use these claims and tokens for websocket to SHWSS security. I dont want my SHWSS answer to unauth requests.
I think It's somehow a SSO scenario. Which flow SHWSS must implement?
Thanks & Regards
public enum Flows
{
AuthorizationCode = 0, //introduced in OAuth2 then extended by OIDC.
Implicit = 1, //introduced in OAuth2 then extended by OIDC.
Hybrid = 2, //introduced in OIDC
ClientCredentials = 3, //OIDC specs didn't extend this flow.
ResourceOwner = 4, //OIDC specs didn't extend this flow.
Custom = 5,
}
Upvotes: 0
Views: 286
Reputation: 7435
The problem with web sockets is that the JS API does not allow setting custom request headers (like Authorization so you can pass a bearer token). I think the assumption is that you would use cookies as the authentication mechanism.
The other idea is to pass the access token as a custom param on every web socket request.
Upvotes: 0