Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rhymesey's avatar

Setting up ldap server on homestead and adding samaccountname

Hi all,

I'm trying to create a development ldap server on my homestead machine so that I can test logging in to my Laravel App. I have followed these instructions to set up ldap on my homestead machine and in Laravel I am using the Adldap2/Adldap2-Laravel package to connect to the local ldap server (both on the same homestead machine).

https://www.sitepoint.com/essentials-ldap-php/

My issue is, the production system will use samaccountname to authenticate but I can't figure out how to add this as an attribute to my local ldap server for each user. If I try and set the samaccountname for a user it I get the following error.

ldap_add: Undefined attribute type (17)
    additional info: samaccountname: attribute type undefined

Here is the ldif file contents

dn: cn=Test User,dc=homestead,dc=localdomain
cn: Test User
objectClass: person
sn: User
userPassword: password
samaccountname: tuser

Thanks

0 likes
0 replies

Please or to participate in this conversation.