Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pretty identifier #12

Open
OmeGak opened this issue Apr 23, 2015 · 0 comments
Open

Add pretty identifier #12

OmeGak opened this issue Apr 23, 2015 · 0 comments

Comments

@OmeGak
Copy link
Member

OmeGak commented Apr 23, 2015

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',
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants