Skip to content

Using sAMAccountName attribute fails to start #88

@mfarwell

Description

@mfarwell

We're trying to use ldap-server in our CI loops and we want to test both LDAPs and ADs that use either the uid or sAMAccountName as the user Id attribute. We'd like to be able to test both scenarios with one LDIF configuration. I was hoping to simply add sAMAccountName as an attribute, but the service fails to start with the following error:

The attribute 'samaccountname' cannot be stored
Exception in thread "main" org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException: ERR_04269 ATTRIBUTE_TYPE for OID samaccountname does not exist!

Here's the LDIF that we're trying to use:

version: 1

dn: ou=TestProg,o=TestCompany,l=TestCity
objectClass: organizationalUnit
objectClass: top
ou: TestProg

dn: cn=progtestuser,ou=TestProg,o=TestCompany,l=TestCity
objectClass: person
objectclass: organizationalPerson
objectClass: inetOrgPerson
cn: progtestuser
sn: progtestuser
uid: progtestuser
sAMAccountName: progtestuser
mail: progtestuser@testcompany.com
userPassword: itachi123%^)
description: EMAILADDRESS=TestProgTeam@testcompany.com, CN=TestProgTestUser, OU=TestProg, O=TestCompany, L=TestCity, ST=NY, C=US
description: 1.2.840.113549.1.9.1=#161648796472615465616d404c334861727269732e636f6d,CN=TestProgTestUser,OU=TestProg,O=TestCompany,L=TestCity,ST=NY,C=US

dn: cn=progtestadmin,ou=TestProg,o=TestCompany,l=TestCity
objectClass: person
objectclass: organizationalPerson
objectClass: inetOrgPerson
cn: progtestadmin
sn: progtestadmin
uid: progtestadmin
sAMAccountName: progtestadmin
mail: progtestadmin@testcompany.com
userPassword: prog99

dn: ou=Group,o=TestCompany,l=TestCity
objectClass: organizationalUnit
objectClass: top
ou: Group

dn: cn=prog-admin,ou=Group,o=TestCompany,l=TestCity
objectClass: top
objectClass: groupOfNames
cn: prog-admin
member: cn=progtestadmin,ou=TestProg,o=TestCompany,l=TestCity

dn: cn=prog-base,ou=Group,o=TestCompany,l=TestCity
objectClass: top
objectClass: groupOfNames
cn: prog-base
member: cn=progtestuser,ou=TestProg,o=TestCompany,l=TestCity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions