Skip to content

Is there a way to update password using ldaprecord-laravel? #350

Answered by stevebauman
leticiacolombo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @leticiacolombo,

Yes absolutely. After setting up your LDAP connection configuration via the config/ldap.php file, query for the user and attempt changing the passord:

use LdapRecord\Models\ActiveDirectory\User;

$user = User::findOrFail('cn=user,dc=local,dc=com');

$user->unicodepwd = ['old-password', 'new-password'];

$user->save();

Here are the docs:

https://ldaprecord.com/docs/core/v2/active-directory/users/#changing-passwords

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@leticiacolombo
Comment options

@stevebauman
Comment options

@reyesmarkdaryl
Comment options

@stevebauman
Comment options

@reyesmarkdaryl
Comment options

Answer selected by stevebauman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants