مع وجود عدة نسخ من Discourse مُفعّل فيها خيار تسجيل الدخول مطلوب وتستخدم SSO، نواجه إعادة توجيه لا نهائية عند تسجيل الدخول عبر Safari على iOS. إليك ما يحدث:
المستخدم غير مسجل الدخول في Discourse أو في موقع SSO الرئيسي.
ينتقل المستخدم إلى نسخة Discourse.
يعيد Discourse توجيه المستخدم إلى صفحة SSO.
تطلب صفحة SSO بيانات الاعتماد. يسجل المستخدم الدخول.
يُعلق المستخدم في حلقة إعادة توجيه بين موقع SSO الرئيسي وDiscourse، حتى يتوقف Safari.
إذا قام المستخدم بعد ذلك بالتنقل يدويًا إلى Discourse مرة أخرى، فإنه يكون مسجّل الدخول.
لا أستطيع تكرار هذا السلوك باستخدام Chrome على سطح المكتب.
أثناء وجود العميل في حلقة إعادة التوجيه، يتم إنشاء عدة سجلات لـ بدأت عملية SSO وتم تسجيل دخول المستخدم، مما يوحي بأن عملية SSO ناجحة، ولكن بطريقة ما، بعد إكمال SSO، يعيد Discourse توجيه المستخدم إلى صفحة تسجيل دخول SSO أخرى بدلاً من صفحة البداية.
هذا يؤثر أيضًا على النسخ القديمة حيث كانت SSO تعمل بشكل صحيح سابقًا، لذا لا أعتقد أن هذه مشكلة في إعدادات Discourse.
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.
You are % 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?)
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.