indico / indico/flask-multipass

Add pretty identifier

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
65
Forks
29
PR merge metrics
No merged PRs in 30d

Description

`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.

``` python
@property
def pretty_identifier(self):
return self.data[provider_settings['pretty_identifier']] if provider_settings['pretty_identifier'] else self.identifier
```

``` python
IdentityProviders = {
'github': {
'type': 'oauth',
'title': 'GitHub',
'oauth': _github_oauth_config,
'identifier_field': 'id',
'pretty_identifier': 'username',
},
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Identity.identifier implementation and the provider configuration represented by IdentityProviders. Trace how provider data is stored and accessed, then verify that a configured display field is used for the user-facing identifier while the existing identifier remains the fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.