Problem on SSO Login

AI-generated summary

The discussion revolves around a problem with SSO (Single Sign-On) login on a Discourse website. yasham07 successfully set up SSO login but encounters an issue where the login button needs to be clicked manually every time, despite being logged in to the main website. Disabling the login required setting allows for automatic login, but this also enables anonymous access, which is undesirable.

yasham07 explained the flow of their website and how SSO login works when login required is disabled. However, when login required is enabled, the login page does not call automatically, requiring a manual click on the login button.

itsbhanusharma suggested enabling login required, disabling local logins, and letting SSO be the only login method, which would present a login page to visitors and allow for automatic login after SSO authentication.

pfaffman asked for clarification on the SSO setup and confirmed that enabling login required is necessary to prevent anonymous access.

michaeld provided a potential solution, suggesting that linking to /session/sso instead of /login would allow for automatic login.

I am successfully created SSO Login. but problem is that whenever I am Login through SSO every time I have to click on Login button.
But I found a method that doesn’t require me to click the login button. The solution is, I disable the login required settings. and I call mywebsite.com which calls login button automatically, but if I disable login required then login button does not call.
I don’t want to give anonymous access to my website. So I can’t use this method.

Does anyone have a better solution so that the login button gets called automatically? Or Any Other Idea?

I don’t understand the question, pardon me if I’m not helpful.

If you enable login required, disable local logins and let the SSO be your only login method, anyone who visits your forum will be presented with a page which has a login button. Once they log in via SSO, they should remain logged in hence no need to click login multiple times. This way anons can not see the site without logging in first.

How? What is the SSO server?

You’re saying that if you have logged in on your SSO site and later visit Discourse you have to click the Login button for Discourse to now that you’re logged in? And what happens when you click the login button?

If you don’t want to allow anonymous access to your site then you do want to enable login_requred.

yes I have to enable login required for disallowed anonymous access.
I am explaining again
The following flow is executed for my website when I enable SSO login and set everything up for SSO login

  1. this is my main website. here a one community button ,when user click this button it will call forum.mywebsite.com/login

  2. forum.mywebsite.com/login call my community(discourse community) website login page. then user who logged in main website is automatically logged as in community website(when I disabled login required setting of community website). But problem is that when I enable login required then login page does not call automatically. I have to click login button manually then It will logged the community page.

So I need some way to call the login button(or page) automatically without disabling login required settings.

This is official SSO Documentation link

Don’t link to /login but to /session/sso to login automatically.