Open briancardonas opened 6 years ago
Hello,
on this part I set both to samaccountname and it worked in my environment: 'usernames' => [ 'ldap' => [ 'discover' => 'userprincipalname', 'authenticate' => 'distinguishedname',
Maybe it works for you.
Nico
Hello, Nico
Thank you for comment...When I do that I get another error (something I use to) the code try to insert again my user data and my database get an error because username is unique...The exact error is: Integrity constraint violation: 1062 Duplicate entry for mi account...
Brian
Hi @briancardonas, what database are you using?
If you're using Postgre or other case-sensitive databases, you need to call strtolower()
on usernames prior to authenticating users.
Hi @stevebauman,
I'm using MySQL and the problem is when I try to autenticate my users using ADLDAP_ACCOUNT_SUFFIX in my .env file It doesn't work I need to override login action to make it works...But...In my opinion I'll prefered if the ADLDAP_ACCOUNT_SUFFIX work's
public function login(Request $request) {
$credentials` = $request->only('username', 'password');
['username'] = $credentials['username'].'@mydomain.local';
(Auth::attempt($credentials)) {
redirect()->route('home');
}
}
I am also experiencing this same issue with my application on a MYSQL database.
Hey everyone, I promise I'm not ignoring you! Just really swamped with internal projects at the moment.
A new user will only be created if the initial lookup of the active directory user in your database returns null.
This lookup is done in the Import::findByCredentials()
method:
https://github.com/Adldap2/Adldap2-Laravel/blob/master/src/Commands/Import.php
Quickest way to debug would be to dump and die the passed in credentials to see what is being queried in your database.
I'll be building in some tools for easier debugging, but for right now that's the quickest way.
Will comment again when I'm on a computer (using phone at the moment).
Thanks for your patience!
No worries, Thanks for the recommendation.
I'm new to this framwork and I can confirm I have the same problem. It works perfectly for the admin suffix but the user suffix won't authenticate the user.
Would be great if this did a simple Str::finish()
to append the domain so I can search with userPrincipalName and allow short or long logins.
Hi @murrant,
Mind sending a PR so I know what you mean for implementation?
I haven't gotten that far yet, need adldap2 working in my project first. We'll see if I get that far...
Description:
Hello, Guys
First of all, I want you to congrats for this exceptional code. I know it'll help me a lot with my Laravel projects. I make one but I actually have a problem whit the ADLDAP_ACCOUNT_SUFFIX config in my .dev file
I can do login with my ActiveDirectory because I follow this instructions: https://github.com/Adldap2/Adldap2-Laravel/blob/master/docs/quick-start.md
But if I have my .env file whitout the config ADLDAP_ACCOUNT_SUFFIX I have to put in my login form username@mydomain.local
If I put the ADLDAP_ACCOUNT_SUFFIX in my .env file and I put in my login form username It doesn't work...I need your help because is a bad think tell my users they need to use username@mydomain.local when they need to sing in to my app.
I attach my actually conf files:
adlap_auth.php
adldap.php
.env
MyLoginForm
Thank you very much for your help. I apologize for my bad English...I wish you could understand what I want and what is not working...