No login methods when using Discourse Connect only

AI-generated summary

The user kev-is-coding-for-adn reports a bug where, with Discourse Connect enabled and local logins disabled, accessing a topic directly (e.g., https://community.adn-soft.com/t/test-categories-sujet-et-etiquette/69) redirects to a /login page showing “No login methods,” instead of using Discourse Connect or redirecting to /login-required. zogstrip investigates and identifies that the issue stems from the “auth immediately” site setting being disabled, which prevents automatic redirection to the SSO endpoint. Enabling this setting resolves the login issue but removes the home page, creating a conflict. kev-is-coding-for-adn confirms this behavior and reverts the change to maintain the home page, highlighting the need for a better solution. The discussion suggests that the “auth immediately” setting may be deprecated in future updates.

Hi,

I wrote a message 2 weeks ago in the “Support” category (Login page "/login" show "no configured method" - #2 by kev-is-coding-for-adn) but no one seems to have an answer for me.

Because I think this is a bug, I will post it here.

My setup is simple :

  • Login required is enabled
  • Discourse Connect is enabled (and working)
  • Local logins and Local Logins by emails are disabled

From an anonymous session, if I go to the home page of my community (https://community.adn-soft.com), it will show the main page with the button to “Log In”. But if I want to go directly to any targeting page (https://community.adn-soft.com/t/test-categories-sujet-et-etiquette/69), I’m redirected to the “/login” page which says “No login methods”.

From my point of view, because I have only 1 login methods configured (Discourse Connect), it should directly use it, or at least show the login page like the home page.

I think that instead of redirecting to “/login”, it should redirect to “/login-required”.

Is there something I’m doing wrong ?

Thanks for your help
Kevin

Tried locally and it worked fine.

As soon as I enter the topic page as “anon” I’m being redirected to the /sso endpoint which then redirects to the local “discourse connect” I have setup & configured (on localhost:5000).

When I try https://community.adn-soft.com/t/-/69

I’m being redirected to the /login endpoint :thinking:

Looking at the code, and especially the redirect_to_login callback, I can see we’ll only redirect to the /sso endpoint when both “discourse connect” is enabled as well as the “auth immediately” site setting

By default, that site setting is enabled, but when I disable it, then

So my guess is that you have that site setting disabled and you should enable it to make it work :+1:


Note: I’m not entirely sure why this site setting exists, but I’m in the process of getting rid of it along with a bunch of other auth-related fix.

1 Like

Yes, you’re completly right.

But if I enable this behavior, then I don’t have any home page anymore.
Just for you to see, I have activated it right now.

If you go to https://community.adn-soft.com, it will directly redirect to the sso provider without showing home page.

Edit : I just put it back to the previous state because I need this home page