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

Not able to perform simultaneous auth flows with different clients #3019

Closed
5 of 6 tasks
sidharthramesh opened this issue Mar 3, 2022 · 3 comments · Fixed by #3059
Closed
5 of 6 tasks

Not able to perform simultaneous auth flows with different clients #3019

sidharthramesh opened this issue Mar 3, 2022 · 3 comments · Fixed by #3059
Labels
bug Something is not working.

Comments

@sidharthramesh
Copy link

sidharthramesh commented Mar 3, 2022

Preflight checklist

Describe the bug

After reading this comment, I understand that Hydra didn't support this 4 years ago (Wow, that's a long time!). However, I feel that when multiple distinct clients are performing the auth flow, hydra should be able to support each of them individually.

Reproducing the bug

  1. Open 2 different apps, with 2 different clients
  2. Initiate the login flow in different tabs of the same browser
  3. Error: The CSRF value from the token does not match the CSRF value from the data store

Version

v1.10.7

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

Here's the use case: We have multiple apps loaded in an iFrame and they all perform the authentication flow simultaneously. This is according to the SMART on FHIR specification for healthcare applications. We need to load all the iFrames simultaneously to optimize the speed of loading. Also, there are instances when multiple apps with different client ids might be opened on different tabs. We don't have control over most of these applications since they are developed by 3rd party developers.

@sidharthramesh sidharthramesh added the bug Something is not working. label Mar 3, 2022
@sidharthramesh
Copy link
Author

sidharthramesh commented Mar 3, 2022

How about setting the cookie name based on the client_id? Or something similar?

More discussions here: https://stackoverflow.com/questions/65493296/authorization-code-flow-concurrent-requests-from-multiple-tabs

@sidharthramesh sidharthramesh changed the title Not able to perform multiple simoultaneous oauth2 auth code with different clients Not able to perform multiple simoultaneous oauth2 auth flows with different clients Mar 3, 2022
@sidharthramesh
Copy link
Author

For example, if instead of
using a constant cookieAuthenticationCSRFName in these places:

if err := createCsrfSession(w, r, s.r.CookieStore(), cookieAuthenticationCSRFName, csrf, s.c.TLS(config.PublicInterface).Enabled(), s.c.CookieSameSiteMode(), s.c.CookieSameSiteLegacyWorkaround()); err != nil {

if err := validateCsrfSession(r, s.r.CookieStore(), cookieAuthenticationCSRFName, session.LoginRequest.CSRF, s.c.CookieSameSiteLegacyWorkaround(), s.c.TLS(config.PublicInterface).Enabled()); err != nil {

if we can somehow make it specific for each client, cookieAuthenticationCSRFName + clientId for instance, do you see it causing any problems?

@sidharthramesh sidharthramesh changed the title Not able to perform multiple simoultaneous oauth2 auth flows with different clients Not able to perform simultaneous auth flows with different clients Mar 3, 2022
@miroljub1995
Copy link

miroljub1995 commented Jun 21, 2022

Any updates on this? Will this resolve only for the different clients running simultaneous, but not e.g. two login sessions for the same client opened in two tabs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
2 participants