Site setting to disable local sign ups

Hello,

I’m looking for a site setting that disables local signups, but maintains OpenID connect new account registrations.

Looking back at user reports from January the majority pointed to a site text This was the error message: New account registrations are not allowed at this time. and would have caused me to enable Allow_new_registrations.

Browsing through all the available settings i can’t see an explicit, registrations allowed via OIDC but not the local site.

I have however used a Data Explorer query to check for any users (acting against ToS of course) using their DevTools to unhide sign up button or selectively disable a JS re-direct;

SELECT
  u.id,
  u.username,
  u.name,
  ue.email,
  u.active,
  u.approved,
  u.created_at,
  u.last_seen_at
FROM users u
LEFT JOIN user_associated_accounts uaa
  ON uaa.user_id = u.id
LEFT JOIN user_emails ue
  ON ue.user_id = u.id
 AND ue.primary = true
WHERE uaa.user_id IS NULL
  AND u.staged = false
ORDER BY u.last_seen_at DESC NULLS LAST, u.created_at DESC

I appreciate that the user acting against my policy, would still need to verify their email address, it’s just that i don’t want user registering that might not have an account in the institution providing me with my OIDC needs.

could alternatively scope must_approve_users with a must_approve_local_users

but this would remove a possibility of disabling initial page that re-directs to /login as a side effect of solving this security vulnerability.

Uncheck enable local logins. That will still allow signups/logins via external methods, like an OpenID provider.

the main issue with unchecking that is my forum then re-directs directly to entra, that makes my forum look like its managed by an institution (while it’s not).

Is your site login required? If so, see this setting:

yes, that’s enabled. That’s the setting i sent a pull request for - to remove the “external” word from the setting description.

So, if you want to show a splash screen on the site but with OIDC enabled as the only login method, you need to:

  • uncheck enable local logins
  • uncheck auth immediately
  • have one external login method enabled

Once those conditions are met, people will see a login required screen like this:

Both buttons here (sign up / login) will lead to your one external login method.

yes, that’s exactly what i did to https://physicswithethan.discourse.diy

I also disabled my custom component “sign up overrides”

1 Like

So you’re all set, or are you missing the Signup button? You can allow new registrations now, it will only enable signup via OIDC.

does disabling auth immediately prevent users creating a new account through the OIDC login flow?

No, it only controls whether the splash is shown or whether users get sent to the login gateway right away.

okay, i adjusted both login_required.welcome_message and site_description, and it made the splash look much more personalised.

I also disabled Auto_skip_create_confirm so my login_required.welcome_message is accurate about choice of username.

2 Likes