שגיאת Rails בעת שימוש ב-DiscourseConnect ו-Wordpress

סיכום מבוסס בינה מלאכותית

Shubh_Bhalla reports a Rails error during DiscourseConnect SSO integration between Discourse (hosted on EC2) and WordPress, resulting in a redirect loop to discourse.mydomain/session/sso and then back to the WordPress site with a signature URL. The issue only appears after clearing cookies for discourse.mydomain, and temporarily resolves when logging in via /u/admin-login — suggesting a session or authentication state dependency. angus confirms this is likely a DiscourseConnect misconfiguration, advises reviewing the official WP Discourse and DiscourseConnect guide, and requests more specific logs — particularly from WP Discourse — to diagnose further. Shubh_Bhalla shares screenshots of the error and confirms the redirect behavior, while angus explains that cookie clearing forces logout, which triggers the SSO flow and exposes the misconfiguration. The issue remains unresolved pending configuration review or additional debugging data.

Hey Angus, I am having the same error as OP and I have attached my logs. Can you please have a look?

Welcome @Shubh_Bhalla :slight_smile:

I’ve moved your post to a new topic as it’s not clear to me if there’s any connection with the topic you posted in.

Could you just confirm a few things for me:

  1. Your issue presents as a redirect loop when attempting to use DiscourseConnect with Discourse and Wordpress via the WP Discourse plugin. Is that right? If it is, is WP Discourse the DiscourseConnect provider?
  2. The log you’ve posted seems to be a backtrace from an exception in Discourse. Could you share the exception itself, i.e. not just the backtrace.
  3. Assuming 1 is true, what logs do have in WP Discourse? Please see WP Discourse logs on how to access them.

Hey @angus . So, my discourse is hosted on an EC2 instance by following through this tutorial. What happens is when I try to access discourse.mydomain, i get redirect to discourse.mydomain/session/sso and then redirect to https://mydomain/#/discourse/sso?sso=bm9uY2U9MTZlNjVmxNGY2M....mcmV0dXJuX3Nzb191cmw9aHR0cHMlM0ElMkYlMkZkaXNjb3Vyc2UuYmlvLWNvbnZlcnNpb24ub3JnJTJGc2Vzc2lvbiUyRnNzb19sb2dpbg%3D%3D&sig=285c1ccdd0a9e18888....c5d32291880c759b which leads to mydomain
The error that it is giving me is -
Screen Shot 2022-08-25 at 9.53.09 AM

Also it is super weird that this only happens when i clear cookies from discourse.mydomain . But this problem fixes itself when i try to login through https://discourse.mydomain/u/admin-login but comes again if we clear cookies for discourse

Your issue is most likely a misconfiguration of DiscourseConnect. Please start from the beginning again and make sure you follow this guide closely. The details you’ve given a bit vague to give you more specific advice than that at this stage.

If you’re still having issues after following that guide closely please ask a question in that topic.

This is happening because by clearing your cookies you are effectively logging yourself out.