goauthentik / goauthentik/authentik
Take the expiration date in LDAP/AD into account
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 644
Description
### Is your feature request related to a problem?
I would like to use the `accountExpires` attribute from Active Directory to automatically deactivate accounts during synchronization.
### Describe the solution you'd like
It would be nice to have an extension of the standard mapping templates.
### Describe alternatives that you've considered
I tried to create my own mapping rule, but it doesn't work.
```
from datetime import datetime, timezone, timedelta
expires = list_flatten(ldap.get("accountExpires"))
now = datetime.now(timezone.utc)
return {
"is_active": not (expires and expires < now),
"attributes": {
"accountExpires": list_flatten(ldap.get("accountExpires")),
"countryCode": list_flatten(ldap.get("countryCode")),
"notes": list_flatten(ldap.get("description"))
}
}
```
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.