I’m trying to configure PrivacyIDEA to authenticate users from our Active Directory using an LDAP resolver, but I’m running into an issue where the policy does not seem to match, and authentication fails.
Configuration details:
LDAP Resolver
LoginName Attribute: sAMAccountName
Search Filter: (sAMAccountName=%s)
Search Filter for User Groups: (memberOf=*)
LDAP configuration has been verified: I can perform successful queries using ldapsearch. I have tested the base DN and filters in multiple ways to make them as general as possible.
PrivacyIDEA version: 3.12.1
Realm: example-realm
Policy: AllowAllTOTP
Observed behavior:
When I send a test authentication request via curl, PrivacyIDEA responds that the user does not exist.
Debug logs indicate that no policies match the user or resolver:
Policies after matching user=exampleuser: []
Policies after matching resolver=: []
Policies after matching pinode=localnode: []
Policies after matching the user_agent=curl: []
Policies after matching client=127.0.0.1: []
Trying to match policy for action "passOnNoUser". Policies: ['AllowAllTOTP']
The LDAP resolver is correctly returning user objects for ldapsearch.
The policy is active, assigned to the correct realm, and associated with a resolver.
Problem:
Despite having a working LDAP resolver and an active policy, the user is not matched and authentication fails.
Has anyone seen similar behavior? Could this be related to how the policy matches the LDAP resolver or the user_agent?
Any guidance or suggestions would be greatly appreciated.
I’m trying to authenticate AD users (username + password + MFA token) from Active Directory using PrivacyIDEA 3.12.1.
The final goal is to integrate PrivacyIDEA with FreeRADIUS, but first I’m testing locally with:
I get the same error ("The user has no tokens assigned"), but from the PrivacyIDEA web interface I can successfully validate the token for this user. If I test the password+token form the web I get ("wrong OTP pin"),
I found that even if a user generates their own TOTP token from the PrivacyIDEA GUI, the token isn’t properly associated with the user until an admin manually “unassigns” and then “assigns” it again from the admin interface.
I discovered this while checking from the pi-manager shell.
At first, when listing the user’s tokens, I got an empty list:
from privacyidea.lib.user import User
u = User("example_user", realm="example_realm")
from privacyidea.lib.token import get_tokens
tokens = get_tokens(user=u)
print(tokens)
# []
After I re-assigned the token from the admin account, I ran the same commands and obtained a valid token object:
So it seems that self-enrolled tokens are not immediately linked in the database, and an admin-level reassignment is required for the system to recognize them.
After this, the error even the “wrong otp pin“ changed for “Invalid comparison in the token conditions of policy 'AllowAllTOTP’“ from the GUI.