joshm
(Josh)
26 مارس 2019، 12:43م
1
Hi!
My users cannot log in with Facebook anymore. This is the error log:
(facebook) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
I’m using Cloudflare in front of nginx. I’m using Cloudflare automatic SSL (flexible). I didn’t install any certificate on my server (i.e. I’m not using Letsencrypt).
Is this related to Cloudflare? Can this be solved without installing Letsencrypt?
Thanks!
This error is similar both for Google and Facebook. In my configuration there was a line in nginx:
# proxy_set_header X-Forwarded-Proto $https;
After I changed it to
proxy_set_header X-Forwarded-Proto $scheme;
the error has gone.
Solution was found after reading this topic: Redirect URI mismatch in Google Auth
إعجابَين (2)
يجب أن أحسّن إجابتي.
بعد اللعب بتسجيل الدخول عبر FB و Google، بقيت على تسجيل الدخول عبر Office365 بسبب سياسة الشركة.
عندما نقلت خادم discourse الخاص بي خلف وكيل (انظر الصورة أدناه)، أصبح تسجيل الدخول عبر O365 غير متاح. يتطلب تمكين force https وهذا الخيار معطل خلف الوكيل. تم حله لحسن الحظ بواسطة Daniel: Moved site behind proxy, favicon and header not using https anymore - #11 by rossierd .
السطر في تكوين Nginx الداخلي
proxy_set_header X-Forwarded-Proto $scheme;
يجب استبداله بـ
proxy_set_header X-Forwarded-Proto "https";
لا يحتاج Nginx الخارجي إلى تعديل مماثل. لديه:
proxy_set_header X-Forwarded-Proto $scheme;
ربما يكون الشيء نفسه صحيحًا لتسجيل الدخول عبر FB و Google وأنواع المصادقة الأخرى.
ملاحظة:
من الواضح أن هذا السطر احتوى على خطأ إملائي $ وكان عديم الفائدة.
إعجاب واحد (1)