Shibboleth and Umlauts

Hi,

i am setting up an indico 3 installation which should replace our indico 2 one, once it is fully functional.

i encountered a problem with umlauts provided by

IDENTITY_PROVIDERS = {
    'shib-sso': {
        'type': 'shibboleth',
        'title': 'LDAP',
        'identifier_field': 'eppn',
        'mapping': {
            'affiliation': 'o',
            'first_name': 'givenName',
            'last_name': 'sn',
            'email': 'mail',
            'phone': 'telephoneNumber'
        },
        'trusted_email': True
    }

so the affiliation of a new user from my university is “Universität Hamburg”, instead of “Universität Hamburg”.

how can i fix this?

That looks like double utf-8 encoding… It doesn’t happen in Indico for sure, so my guess would be that you either already get bad data from SSO or shibd somehow messes it up.

However, since you are on Indico 3, you may want to try the native SAML option instead; debugging issues there will be certainly easier than with Shibboleth.

That looks like double utf-8 encoding… It doesn’t happen in Indico for sure

that is true, the problem occurs in even the most minimalistic setup:

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html; charset=utf-8')])
    x=env['givenName']
    return [x.encode('utf-8')]

i assume that uwsgi is causing the problem, but i can’t prove it.

However, since you are on Indico 3, you may want to try the native SAML option instead

i would like to avoid migrating to indico 3 and registering a new serviceprovider at the same time, so for now i am using this rather nasty patch

lib/python3.9/site-packages/flask_multipass/providers/shibboleth.py

def _lower_keys(iter_):
    for k, v in iter_:
        yield k.lower(), (v.encode('raw_unicode_escape').decode('utf8') if v.__class__.__name__=='str' else v)

after the migration i’ll check out the new native saml support.