Skip to content

Add migration support for identifiers #1954

Description

@nijel

Historically, some backends do not use optimal identifiers for users (like #1951). Changing the ID_KEY now breaks all existing authentications. I think it should be possible to support migration to different ID_KEY.

  • Add id_key to the UserMixin (and AbstractUserSocialAuth in the Django app).
  • Upon authentication, first look for id_key matching id_key() (exact matches).
  • Fallback to matching uid with a blank id_key (migration path for existing entries without it).
  • Attempt fallback against extra_data (this should handle the changed setting, but the question is whether extra_data actually contains all needed bits).
  • The id_key and uid would then be updated accordingly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions