Hi Lian,
first of all, thank you for the comprehensive explanation.
I think the error lies in the initialization of the ATTRIBUTE_MAP variable in views.py. I logged the value of the variable during the login process and it has two values:
[INFO] seahub.oauth.views:44 <module> ATTRIBUTE_MAP = {'userCN': (True, 'email'), 'id': (True, 'email')}
The first value is from my seahub_settings and the second is initialized in views.py:
ATTRIBUTE_MAP = {
'id': (True, "email"),
}
ATTRIBUTE_MAP.update(getattr(settings, 'OAUTH_ATTRIBUTE_MAP', {}))
I changed this to
#ATTRIBUTE_MAP = {
# 'id': (True, "email"),
#}
# ATTRIBUTE_MAP.update(getattr(settings, 'OAUTH_ATTRIBUTE_MAP', {}))
ATTRIBUTE_MAP = getattr(settings, 'OAUTH_ATTRIBUTE_MAP', {})
Now the attribute only has one value, as expected:
[INFO] seahub.oauth.views:45 <module> ATTRIBUTE_MAP = {'userCN': (True, 'email')}
and the oauth login works 