Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide JWT tokens to Websocket without passing via HTTP headers #667

Closed
thjaeckle opened this issue Apr 30, 2020 · 1 comment · Fixed by #1041
Closed

Provide JWT tokens to Websocket without passing via HTTP headers #667

thjaeckle opened this issue Apr 30, 2020 · 1 comment · Fixed by #1041
Milestone

Comments

@thjaeckle
Copy link
Member

For the WebSocket browser API it is not possible to pass a JWT token as Authorization HTTP header as this API does not allow to set custom headers.

So there is no straight-forward way to connect to a Ditto websocket from the browser.

We should enable that by either

  • allowing to open an unauthenticated WS session and passing as first message the JWT token via the WS
  • or by using the sub-protocol field of the WS (for which there is an API in the browser) in order to transport the JWT token

I would prefer the first one as we already do the JWT token refresh also via a WS message.

@thjaeckle thjaeckle added this to the 1.2.0 milestone Apr 30, 2020
@thjaeckle thjaeckle removed this from the 1.2.0 milestone Aug 7, 2020
@thjaeckle thjaeckle added this to the 1.3.0 milestone Aug 26, 2020
@thjaeckle thjaeckle modified the milestones: 1.3.0, 1.4.0 Sep 16, 2020
@thjaeckle thjaeckle removed this from the 1.4.0 milestone Oct 23, 2020
@thjaeckle thjaeckle added this to the 1.5.0 milestone Nov 2, 2020
@thjaeckle thjaeckle removed this from the 1.5.0 milestone Nov 10, 2020
@thjaeckle thjaeckle added this to the 2.0.0 milestone Dec 15, 2020
@thjaeckle thjaeckle modified the milestones: 2.0.0-M1, 2.0.0 Feb 18, 2021
@thjaeckle thjaeckle modified the milestones: 2.0.0, 2.1.0 Mar 25, 2021
dguggemos added a commit to bosch-io/ditto that referenced this issue Apr 28, 2021
…for websocket requests

Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
dguggemos added a commit to bosch-io/ditto that referenced this issue Apr 28, 2021
…nal option for providing the jwt

Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
thjaeckle added a commit to bosch-io/ditto that referenced this issue Apr 29, 2021
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
@thjaeckle thjaeckle modified the milestones: 2.0.1, 2.0.0 May 10, 2021
@ameinhardt
Copy link

Browser are able to pass cookies before the upgrade handshake, so the JWT could be passed there, also. That is straight-forward, as long as the browser has gotten a suitable cookie from the ditto domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants