How validate user and password in the Active directory ? #564
hdkcreative
started this conversation in
General
Replies: 1 comment 1 reply
-
Solution 1 : $user = LdapUser::on('my-subdomin-a')->where('samaccountname', $username)->first(); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys !
we are using
Laravel 10
PHP 8.1
we want validate and authenticate users in our A.D
we have this setup:
.env file
in config/ldap.php we have
in /app/Services/LdapAuthService.php we have this code ( the service recive the data from the form username and password)
this print all information of the user... ok good
*But we need verify the password, how we can do it ?
we are try with
$connection = Container::getConnection('default');
$connection->connect($username, $password);
$authenticated = $connection->auth()->attempt($username, $password);
and this return Error: Invalid credentials
We hope you can help us with this question. !!!
Beta Was this translation helpful? Give feedback.
All reactions