"Login error" page during the login attempt by existing user previously added through SSO

Hi there. The whole “SSO loop” (send the user to our site → authenticate → send back to Forum with signed payload) seems to be set correctly as the first user was added properly (I can see the user in the admin dashboard with DiscourseConnect Single Sign On details). However, after the user logs out from the forum and tries to log back in, he sees the “Login Error” page. The log file’s log says “Completed 422 Unprocessable Entity”. I’ve checked sso and sig → everything is correct. How or where can I find the reason for that error?

It might be worth creating a test user and seeing if you can reproduce the error with that account. Try going through the login process with your browser’s inspector opened to its Network tab. That might give you some details about what’s triggering the 422 error.

If you haven’t already done so, enable the verbose discourse connect logging setting on Discourse. That setting adds some additional log entries to the Discourse logs.

If you are seeing this in the Discourse logs, are there any additional details about the request shown when you click on the log entry?

There’s some information about debugging common DiscourseConnect issues here: Debug and fixing common DiscourseConnect issues. I’m not sure that it’s relevant to your case though.


Hey Simon, thank you so much for the advice to enable verbose discourse connect logging! In the log, I was able to find the issue immediately. My mistake was to hash sso after it was URL encoded. For the signature to work, sso should be hashed after it was base64 encoded but prior to URL encoding. Thank you so much for helping me!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.