Skip to content

Add pretty identifier #12

@OmeGak

Description

@OmeGak

Identity.identifier, while being the uid in the identity provider it is also quite meaningless when displayed to users (i.e. For Github, it is a numeric id instead of the username). We should have a way to specify which data field of the identity from a provider is the one relevant to the user. Something along this line would be a first approach to tackle it.

@property
def pretty_identifier(self):
    return self.data[provider_settings['pretty_identifier']] if provider_settings['pretty_identifier'] else self.identifier
IdentityProviders = {
    'github': {
        'type': 'oauth',
        'title': 'GitHub',
        'oauth': _github_oauth_config,
        'identifier_field': 'id',
        'pretty_identifier': 'username',
    },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions