<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[LDAP login fails when username contains dots - Taiga strips special characters]]></title><description><![CDATA[<p dir="auto">Describe the bug<br />
LDAP authentication fails when the LDAP username contains dots (e.g., john.doe). Taiga strips dots from usernames during user creation, storing johndoe instead of john.doe. On subsequent LDAP logins, the plugin looks up john.doe, doesn't find it, and tries to create a new user, which fails due to duplicate email constraint.<br />
To Reproduce</p>
<p dir="auto">User with LDAP uid john.doe and email <a href="mailto:john.doe@example.com" target="_blank" rel="noopener noreferrer nofollow ugc">john.doe@example.com</a> logs in for the first time<br />
Taiga creates user with username johndoe (dot stripped)<br />
User logs in again via LDAP<br />
Plugin searches for username john.doe - not found<br />
Plugin tries to create new user - fails with duplicate email error</p>
<p dir="auto">Error Log:</p>
<pre><code>taiga.users.models.User.DoesNotExist: User matching query does not exist.
During handling of the above exception, another exception occurred:
django.db.utils.IntegrityError: duplicate key value violates unique constraint "users_user_email_243f6e77_uniq"
Proposed Fix
Option A: Normalize username before lookup (strip dots to match Taiga's behavior)
python@transaction.atomic
def ldap_register(username: str, email: str, full_name: str):
    user_model = get_user_model()
    normalized_username = username.replace('.', '')
    try:
        user = user_model.objects.get(username=normalized_username)
    except user_model.DoesNotExist:
        user = user_model.objects.create(
            email=email,
            username=normalized_username,
            full_name=full_name
        )
    return user
Option B: Lookup by email as fallback
python@transaction.atomic
def ldap_register(username: str, email: str, full_name: str):
    user_model = get_user_model()
    try:
        user = user_model.objects.get(username=username)
    except user_model.DoesNotExist:
        if email:
            try:
                user = user_model.objects.get(email=email)
                return user
            except user_model.DoesNotExist:
                pass
        user = user_model.objects.create(
            email=email,
            username=username,
            full_name=full_name
        )
    return user
</code></pre>
]]></description><link>https://forum.cloudron.io/topic/14761/ldap-login-fails-when-username-contains-dots-taiga-strips-special-characters</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 10:28:37 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/14761.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Dec 2025 11:27:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LDAP login fails when username contains dots - Taiga strips special characters on Wed, 17 Dec 2025 14:49:05 GMT]]></title><description><![CDATA[<p dir="auto">We published a new app which should fix this now.</p>
]]></description><link>https://forum.cloudron.io/post/117258</link><guid isPermaLink="true">https://forum.cloudron.io/post/117258</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Wed, 17 Dec 2025 14:49:05 GMT</pubDate></item><item><title><![CDATA[Reply to LDAP login fails when username contains dots - Taiga strips special characters on Wed, 17 Dec 2025 13:21:19 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a><br />
I also think that we had worked on this issue before.<br />
I am looking into it.</p>
]]></description><link>https://forum.cloudron.io/post/117253</link><guid isPermaLink="true">https://forum.cloudron.io/post/117253</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Wed, 17 Dec 2025 13:21:19 GMT</pubDate></item><item><title><![CDATA[Reply to LDAP login fails when username contains dots - Taiga strips special characters on Wed, 17 Dec 2025 11:46:50 GMT]]></title><description><![CDATA[<p dir="auto">This seems to be the same as <a href="https://forum.cloudron.io/topic/14497/cloudron-auth-support-doesn-t-seem-to-work/6">https://forum.cloudron.io/topic/14497/cloudron-auth-support-doesn-t-seem-to-work/6</a></p>
<p dir="auto">I thought we had fixed that with the other auth module. <a class="plugin-mentions-user plugin-mentions-a" href="/user/james" aria-label="Profile: james">@<bdi>james</bdi></a> do you remember?</p>
]]></description><link>https://forum.cloudron.io/post/117252</link><guid isPermaLink="true">https://forum.cloudron.io/post/117252</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Wed, 17 Dec 2025 11:46:50 GMT</pubDate></item></channel></rss>