Skip to content

Determine desired password-handling behavior for ExternalLoginUsers #1036

Open
@morrildl

Description

@morrildl

Filing per @strk via gitter, for discussion to arrive at a design.

#679 and #1010 add support for logging in via OAuth2 (and "OpenID Connect") accounts; #618 adds support for (classic) OpenID. This bug is a proposal for how to handle local-to-gitea passwords for such accounts.

From discussions on the above PRs and gitter, there seem to be 3 primary considerations:

  1. Need for some way to authenticate git-over-HTTP[S] writes
  2. Whether the local Gitea account is expected by users/admins to be recoverable/usable if the upstream OAuth2 account goes away (i.e. can you still log in if you delete your Google/FB/Github account, etc.)
  3. What are the right model & UI representations for such accounts & passwords (i.e. what LoginType, whether passwords should be toggle-able via admin UI, etc.)

The options I can think of are:

  • Suppress all passwords in UI for OAuth2 accounts, and forbid HTTP[S] git operations -- require SSH-git for these users (allowing HTTP[S] for local-only accounts)
  • Suppress (or make optional) passwords during OAuth2 self-reg, and use them only for HTTP-git operations
  • Make local passwords a first-class auth mechanism; basically this makes OAuth2 a secondary login mechanism [this is how the OAuth2 code currently works]

Besides the above, there is also a secondary consideration:

  • How OAuth2 accounts should interact with self-registration: it's difficult to pre-register local accounts for OAuth2 because the "real" OAuth2 ID is typically an opaque string that it is essentially impossible for an admin to know in advance, meaning in practice you can't currently enable OAuth2 and also turn off self-registration

For this, there are again a few options:

  • Do not support disabling self-reg if OAuth2/OpenID is enabled as an auth source
  • Support disabling self reg, and add a feature allowing admins to restrict self-registrations to a whitelist of email domains
  • Support disabling self reg, and add a full-fledged "these users have requested accounts" moderation UI for admins

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/authenticationtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions