indico / indico/flask-multipass
Mail attribute from IdP is delivered as List of Addresses
- Dominant language
- Python
- Stars
- 65
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**Problem Description**
During the authentication procedure against our identity provider using the shibboleth method, one gets back a list of attributes including among others like `Eppn`, `Cn`, `Givenname`, `Sn` the attribute `Mail`. In our IdP case this is not a single email address, but a list of the primary address followed by an arbitrary list of aliases. This looks e.g. like:
`Mail = 'primaryemail@eample.org;alias1@eample.org;alias2@example.org; ...'`
Or given in the full context (as example):
```
{u'data': {u'get': {},
u'headers': {'Accept': u'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding': u'gzip, deflate, br',
'Accept-Language': u'de,en;q=0.8,fr;q=0.5,en-US;q=0.3',
...
'Host': u'indico-site.example.org',
'Mail': u'primaryemail@eample.org;alias1@eample.org;alias2@example.org',
'O': u'some-organisation',
'Ou': u'',
...
```
It seems, that indico requires a single email address at this point, as the data set shown upon login is the full string of all emails. This does not allow the `Mail` field to be used in the user data set in indico.
**Solution Proposal**
It seems this problem could be solved by adding some parameters to the `indico.conf` syntax. One parameter covering the field separator and another one indicating which one of the fields should be taken as email address.
An `indico.conf` could for example look like the following:
```
IDENTITY_PROVIDERS = {
...
'our-location-sso': {
'type': 'shibboleth',
'title': 'Shibboleth User Login)',
'identifier_field': 'eppn',
# proposed new parameters:
'mail_array': True,
'mail_separator': ';',
'mail_index': 0,
# end of new parameters
'mapping': {
'first_name': 'givenName',
'uid': 'eppn',
'last_name': 'sn',
'Sn': 'sn',
'mail' : 'eppn',
...
}
}
...
```
This is my proposal. The example has three new parameters. `mail_array` defaulting to `False`, so that current configs will not get broken for backward compatibility, `mail_separator` containing the field separator of the string and `mail_index` providing the index in the mail array that provides the email address to be chosen by indico.
Contributor guide
No contributing guide indexed for this repository
Research direction
No file or test is named in the report. Start by tracing the Shibboleth provider and identity mapping configuration, then inspect how the Mail attribute becomes user data; done means selecting one address from a separated value while preserving existing single-value configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100