You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
I'm trying to login with email address (as userprincipalename) and password in a NoDatabaseUserProvider configuration but the Auth::attempt() return always false. On the other hand, Adldap::auth()->attempt($request->userprincipalname, $request->password, $bindAsUser = true); it return true and also Adldap::search()->findBy('userprincipalname', $username) works correctly. So, where I'm wrong? :(
thank you in advance
This is definitely the right way when using ActiveDirectory. The authenticate value is what to use as the users username when calling ldap_bind() on your configured LDAP connection. Setting it to password won't work.
For example, in ActiveDirectory, a users Distinguished Name or User Principal Name can be used as a username to bind to ActiveDirectory servers:
// Using UPN:$userPrincipalName = 'jdoe@acme.org';
ldap_bind($conn, $userPrincipalName, 'secret-password');
// Using DN:$dn = 'cn=John Doe,ou=Users,dc=acme,dc=org';
ldap_bind($conn, $dn, 'secret-password');
So you can actually use either distinguishednameoruserprincipalname as the value for the authenticate option. They will both work.
Description:
I'm trying to login with email address (as userprincipalename) and password in a
NoDatabaseUserProvider
configuration but theAuth::attempt()
return always false. On the other hand,Adldap::auth()->attempt($request->userprincipalname, $request->password, $bindAsUser = true);
it return true and alsoAdldap::search()->findBy('userprincipalname', $username)
works correctly. So, where I'm wrong? :(thank you in advance
config/auth.php
config/ldap_auth.php
App\Http\Controllers\Auth\LoginController
login.blade.php
The text was updated successfully, but these errors were encountered: