etianen / etianen/django-python3-ldap

LDAP_AUTH_USER_FIELDS fails to map the retrieved data

Open
#282 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
428
Forks
122
PR merge metrics
No merged PRs in 30d

Description

LDAP_AUTH_USER_FIELDS = {
'username' : 'un',
'det1' : 'n1',
'det2' : 'n2',
'det3' : 'n3',
'det4' : 'n4',
}
During the LDAP, sometimes the code will end up executing correctly because the fields being mapped are present in the retrieved user details.
The code will run in the case where we have all the attributes available, [un, n1, n2, n3, n4].
But in case, there are attributes that were not received, say `n3` and `n4` are missing for some users, the auth happens and as the details were partially existing, the code will try to map the key to it and ends up with an error.

Is there a way to fetch all the available attributes, after the authentication was successfully done, I don't mind mapping manually later on after using the user class.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.