Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported ldap users: The username contains invalid characters with Active Directory UPN #2242

Closed
nantoine555 opened this issue Mar 5, 2018 · 3 comments
Assignees
Labels
bug Production bug

Comments

@nantoine555
Copy link

I'm using an Active Directory LDAP with "userPrincipalName" as username.

So I have usernames like "pname@domain.com".

First import from ldap is ok, but further editing is raising an error "The username contains invalid characters"

Is there a reason not to accept '@' for username, and less than 32 characters in system_usermanager.php?

    if (preg_match("/[^a-zA-Z0-9\.\-_]/", $pconfig['usernamefld'])) {
        $input_errors[] = gettext("The username contains invalid characters.");
    }
    if (strlen($pconfig['usernamefld']) > 32) {
        $input_errors[] = gettext("The username is longer than 32 characters.");
    }
@AdSchellevis
Copy link
Member

yes, usernames are created locally and thus have the same constraints as local (FreeBSD) users.

@nantoine555
Copy link
Author

Maybe I should not be able to add such usernames then?

@AdSchellevis
Copy link
Member

you're definitely right, if the import accepted it, the local user should be cleansed before input (logically pname@domain.com should turn into pname as local user).

@AdSchellevis AdSchellevis self-assigned this Mar 5, 2018
@AdSchellevis AdSchellevis added the bug Production bug label Mar 5, 2018
fichtner pushed a commit that referenced this issue Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

2 participants