Skip to content

Disabling an OAuth provider does not block sign-in #385

Description

@cavidelizade

Summary

Turning off an OAuth provider in instance settings hides its login button but does not actually block sign-in. Hitting the provider's route directly still completes a full login.

Where

internal/handler/oauth.go (Initiate/Callback/resolveProvider) and oauth_config.go. resolveProvider builds a provider purely on credential presence (client id + secret non-empty). Neither Initiate nor Callback ever checks the auth settings section's per-provider booleans (auth.google / auth.github / auth.gitlab), even though InstanceAuthConfig computes is_<provider>_enabled = <provider>Allowed && credentialsReady, so that toggle is the documented on/off switch.

Repro

As an instance admin, disable GitHub SSO (auth.github = false) but leave the client credentials in place (the normal way to turn a provider off). The login page hides the GitHub button, but navigating directly to GET /auth/github/ then the callback completes a full sign-in, and if public signup is on, provisions an account. allow_public_signup is re-checked in the callback, but the provider-enabled flag is not.

Suggested fix

In resolveProvider/Callback, reject the provider unless its auth.<provider> boolean is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions