-
Notifications
You must be signed in to change notification settings - Fork 193
Login authenticates properly with AD first time. Afterward any pw will work. #263
Comments
I can definitely assure you this is not the case. Something else is going on here. Have a couple questions:
|
I tried setting the "follow_referrals" to false and it still does the same thing. If I leave the password field blank it complains about it, so that is working to properly. Here is the login controller... LoginController.php middleware('guest', ['except' => 'logout']); } public function username() { return 'username'; } } |
Ok, in your routes file, can you try authenticating with the user and see if it just returns true? // routes/web.php
$auth = Auth::attempt([
'username' => 'my-username',
'password' => 'random password',
]);
dd($auth); // What does this return?
Also, in your case above is true, this should also return true: // routes/web.php
$auth = Adldap::auth()->attempt('my-username', 'random password');
dd($auth); If the second case returns true, something is going on with your AD server. |
The first method returned the following error regardless of proper credentials or not: InvalidArgumentException in CreatesUserProviders.php line 40: The result of the second attempt is simply the message: false. That being said, if I put the proper credentials in for the second method it does return true. |
@2Foot, sorry I should have specified, insert the methods inside a route: // routes/web.php
Route::get('/', function () {
$auth = Auth::attempt([
'username' => 'my-username',
'password' => 'random password',
]);
dd($auth); // What does this return?
}); You'll receive that exception if it isn't contained in a closure in your routes file, since the adldap auth provider hasn't been registered yet. |
hahaha, do not apologize. That is MY fault. It's still too early in the day on a Monday where I am and my brain hasn't had enough caffeine yet! Ugh. Sorry. So now the first method returns true with the WRONG credentials as well as the right ones. |
Fixed! This was actually a major security issue so I'm extremely glad you brought this to my attention. The series of events for this to occur:
Please update to |
No problem! Glad I could help. Thank you for the quick response. I hope to be able to use SSO soon but my web server is CentOS and I need it to talk securely to AD through Kerberos. If you have any tips or resources please let me know! Communicating with AD is all new to me. I thought I had done everything properly but... you never know. Lol. Thanks again. |
then how about to call data (eg email) from ldap server to display into my system? For example I have a db employee which stores name data, username and password. Then I also have ldap server that stores data name, username, password, position. Then when i login, i will be authenticated in db employee and ldap server to check my username exists or not. Then, after I successfully login, then I will be able to see the data name, email, and position taken from ldap server which is displayed into my system web. |
If you insert the $user = Auth::user();
$user->ldap->getCommonName();
$user->ldap->getGroups();
// Etc. Please refer to the documentation for this feature: https://github.com/Adldap2/Adldap2-Laravel/blob/master/docs/auth/binding.md |
where i should put this code ?
|
That is just example usage. This is located in your |
here's my code ; user.php
logincontroller.php
please correct me if i'm wrong. |
Uh oh!
There was an error while loading. Please reload this page.
Description:
If I clear the users table and try to sign in with the wrong password it will fail. Once I sign in successfully it stores my user into the user's table. Seems fine. Then I logout and try to sign in again but with the wrong password and it lets me login with a bad password.
Steps To Reproduce:
Once a user logs in fine through AD and there is a user entry in the table for that user then using that login with any password allows login. It's like it's only verifying username exists... ?
auth.php
`<?php
return [
];`
adldap.php
`<?php
return [
];
`
adldap_auth.php
`<?php
return [
];
`
I'm sure it's something small and stupid I am missing but... I can't stare at it any longer! Lol.
The text was updated successfully, but these errors were encountered: