goauthentik / goauthentik/authentik

unable to set user field is_active to false with property mappings

Open
#10,439 7 comments 0 reactions 1 assignee Claimed by @dewi-tik View on GitHub
bug bug/confirmed needs_documentation
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 1h
Merged PRs (30d)
644

Description

**Describe the bug**
I tried to disable users which are marked as `lockedOut` in the LDAP source.
Therefore I use the `lockoutTime` property try to set the `is_active` user field with a property mapping:

Name: disable user when LDAP lockedOut
Object field: `is_active`
Expression:
```python
# Debug object field: attributes.lockedOut to verify logic
#
lockoutTime = ldap.get('lockoutTime')

if lockoutTime.timestamp() > 1:
return True
else:
return False
```
But all users are still marked as active.

**To Reproduce**
Steps to reproduce the behavior:

- add the Property Mapping like described above
- use the mapping in the federation config / ldap source
- manually run ldap sync

**Expected behavior**
- Users should be disabled when ldap field `lockoutTime` is set.

**Version and Deployment (please complete the following information):**

- authentik version: 2024.6.0
- Deployment: docker-compose

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.