Reindirizzamento SSO infinito su Safari

Con più istanze di Discourse configurate con login richiesto e che utilizzano SSO, stiamo riscontrando reindirizzamenti infiniti durante l’accesso con Safari su iOS. Ecco cosa accade:

  1. L’utente non è loggato né su Discourse né sul sito master SSO.
  2. L’utente naviga verso l’istanza di Discourse.
  3. Discourse reindirizza alla pagina SSO.
  4. La pagina SSO richiede le credenziali. L’utente effettua il login.
  5. L’utente rimane bloccato in un ciclo di reindirizzamento tra il sito master SSO e Discourse, finché Safari non interrompe l’operazione.
  6. Se l’utente successivamente naviga manualmente nuovamente verso Discourse, è già loggato.

Non riesco a riprodurre questo comportamento con Chrome su desktop.
Mentre un client è intrappolato nel ciclo di reindirizzamento, vengono generati molteplici voci Started SSO process e User was logged on, il che suggerisce che il processo SSO abbia avuto successo; tuttavia, al termine dell’SSO, Discourse reindirizza l’utente a un’altra schermata di login SSO invece che alla pagina iniziale.

Questo problema interessa anche istanze vecchie in cui l’SSO funzionava correttamente in precedenza, quindi non credo si tratti di un problema di configurazione di Discourse.

Qualcuno ha un’idea di cosa possa non funzionare?

Any ideas on this @sam?

I have seen this on sites that have the setting same site cookies set to Strict, if it is already on Lax recommend attempting to disable and see if it works around the Safari bug.

Maybe the new Safari Tech Preview from today will fix it:

Fixed Same-Site Lax cookies to be sent with cross-site redirect from a client-initiated load (r241918)

You are :100:% correct. It was on Lax, the default. Changing it to Disabled fixed the issue immediately. (I assume this is a defense-in-depth thing, on top of your usual CSRF protections, so disabling it is not overly terrible for security?)

Let’s hope for the best!

Thank you for your help!


I rate you :star2::star2::star2::star2::star2::mage::mage: (five stars plus wizarding level two)!

:man_facepalming: I’ve spent a very long time figuring out a similar issue was caused by this samsite=lax behaviour:

This fixes my issue - at least on macOS Mojave - so I assume it fixes it on iOS too. Thanks!

I’d also like to know people’s opinions on this.

What with this being the Mozilla Discourse and all, we don’t have a huge amount of traffic from Safari, so don’t want to make ourselves vulnerable to CSRF attacks for something which will benefit a very small proportion of our users.