Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Let the Spam Checker know whether the registration came from an SSO provider #9572

Closed
lampholder opened this issue Mar 9, 2021 · 2 comments · Fixed by #9626
Closed

Let the Spam Checker know whether the registration came from an SSO provider #9572

lampholder opened this issue Mar 9, 2021 · 2 comments · Fixed by #9626
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@lampholder
Copy link
Member

Right now we call spam_checker.check_registration_for_spam with both native, local, Synapse registrations and with the "first login" of SSO users.

If a homeserver is running with both native and SSO-provided logins, it'd be good to expose to the spam checker the nature of the registration - perhaps by passing in auth_provider_id to the check_registration_for_spam call?

@anoadragon453
Copy link
Member

@richvdh how would you feel about passing auth_provider_id to SpamChecker modules? Or should we try to pass some sort of opaque constant instead (AS vs. SSO vs. Native)?

@anoadragon453 anoadragon453 added T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. X-Needs-Discussion labels Mar 10, 2021
@richvdh
Copy link
Member

richvdh commented Mar 10, 2021

seems reasonable enough to me

richvdh pushed a commit that referenced this issue Mar 16, 2021
Fixes #9572

When a SSO user logs in for the first time, we create a local Matrix user for them. This goes through the register_user flow, which ends up triggering the spam checker. Spam checker modules don't currently have any way to differentiate between a user trying to sign up initially, versus an SSO user (whom has presumably already been approved elsewhere) trying to log in for the first time.

This PR passes `auth_provider_id` as an argument to the `check_registration_for_spam` function. This argument will contain an ID of an SSO provider (`"saml"`, `"cas"`, etc.) if one was used, else `None`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants