Can this be allowed at a per-instance level?
סיכום מבוסס בינה מלאכותית
The thread addresses whether social logins can remain active while two-factor authentication (2FA) is enabled in Discourse. roke_julian_lockhart references previous guidance stating that enabling 2FA typically disables social logins, asking if this behavior can be adjusted at the instance level. awesomerobot clarifies that the site setting Enforce second factor on external auth controls this behavior; when disabled, users can log in via social providers without 2FA, even if 2FA is required for local accounts. Adam_Root notes that while this setting allows both login methods, it means social logins bypass Discourse’s 2FA requirement, so external providers must enforce their own security if 2FA is mandatory for all users.
The discussion includes a minor misunderstanding regarding terminology. pfaffman initially misunderstood the request, confusing “instance” with an OAuth provider instance rather than the Discourse site. roke_julian_lockhart clarified they meant the Discourse instance and questioned why the default setting enforces 2FA on external auth even when 2FA isn’t mandatory site-wide. pfaffman later acknowledged the confusion, confirming that settings are per-Discourse-instance and do not affect other installations. Ultimately, roke_julian_lockhart confirms that the answer to their core question is yes: the enforcement of 2FA on OAuth logins can be disabled via the site setting.
There’s a site setting called Enforce second factor on external auth — when it’s disabled you can log in using a social provider without two factor auth while still having 2FA enabled for local logins
What are you asking? You want to turn on 2 factor? Yes, you can do that.
That’s a useful setting to know about. I think the main thing to consider is that disabling it allows social logins without enforcing Discourse’s 2FA requirement.
It works well if the goal is to keep both login options available, but if 2FA is required for all users, the external authentication providers would need to enforce it separately.
@pfaffman, I didn’t set this thread title, but @awesomerobot (who did) has already provided an actionable answer. The context is:
Thanks, all. However, why is that preference separate to having 2FA mandatory instance-wide? I don’t understand why, at instances without 2FA required, that preference defaults to enabled. Should that question be another thread?
I see now. I was thrown by “instance”, which I take to mean “Discourse instance” meaning “OAuth instance” (Google, Github, etc). I think I should have been able to figure that out, but failed. ![]()
@pfaffman, actually, I did mean “Discourse instance”. I am not familiar with what an instance of OAuth would entail, per se…
The question, then seems to be “can I enable the setting that requires 2FA on my Discourse site” and the answer is yes (the solution). There are no settings that you change that affect other instances. ![]()
@pfaffman, as @awesomerobot has already answered, my question was whether enforcing OAuth2 disconnection upon 2FA registration is possible to disable. It appears to be.