I got the LDAP authentication working but now I need two more things.
- I need to add the new User to the permission group default.
- And I need to store the department field additionally to the User.
For the first Problem I didn't find any solutions. I can only set boolean fields in the user model by using the AUTH_LDAP_USER_FLAGS_BY_GROUP directive.
How can I add the new User to this group?
The second Problem: I map the following fields to the django user model:
AUTH_LDAP_USER_ATTR_MAP = {
"first_name": "givenName",
"last_name": "sn",
"email": "mail"
}
The default user model does not have a department field. I could create a new model that inherits from the user model. But how can I tell the ldap-auth to use my own model?