Discourse SSO failed to login the user while redirection

AI-generated summary

Discourse SSO Issue

narayanan is experiencing an issue with Discourse SSO (Single Sign-On) in their .Net application. When loading the Discourse forums site directly and clicking the login button, SSO works as expected. However, when accessing a Discourse link from their site after logging in, SSO fails to log the user in.

The issue can be bypassed by appending session/sso to the URL, which redirects the user to the Discourse site with a successful login.

The Discourse version is 2.8.0.beta9, and there are no errors in the logs, but a console issue is reported. narayanan is seeking help to identify the root cause and fix the issue.

Hi,

We have configured Discourse SSO with my site(.Net application). If I directly load the discourse forums site and clicking login will take us to my site login page, once user logged in, it will redirect the user to discourse forums site with logged in credentials. So here the SSO was working fine.

But now, I am loading my site and logged in. Once I clicked any discourse forums links (ex: https://forums.xyz.org/t/covid-elearning-suite-better/500/3) from my site, it’s redirecting to the discourse site without logged in. Here the SSO fails to login.

At the same time, if user clicking the link (ex: https://forums.xyz.org/session/sso?return_path=https://forums.xyz.org/t/covid-elearning-suite-better/500/3) which has “session/sso” redirected the users to discourse forums site with successfully logged in.

Below is the SSO settings pic:

Our discourse version: Discourse 2.8.0.beta9

Can’t find anything regarding that with error logs. But got some console error refer below,

Can anyone know the root cause why this issue coming ? and also can anyone help me to fix the issue ?