I used openldap to users login authentication in my old app , it's Ok with this informations :
ldap_host = "ldap.hiat.edu.lb"
ldap_domain = "hiat.edu.lb"
ldap_binddn = "cn=manager,dc=hiat,dc=lb"
ldap_bindpwd = "my_ldap_passwd"
ldap_rootdn = "dc=hiat,dc=lb"
ldap_searchattr = "uid"
ldap_fname = "givenname"
ldap_lname = "sn"
ldap_uname = "uid"
ldap_email_add = "mail"
ldap_phone = "telephonenumber"
ldap_context = "dn"
ldap_uidnumber = "uidnumber"
This was good
When I tried to moved the app to laravel and use adldap2-laravel, I used the same information in <.env> file and i wrote in LoginController.php file and I followed all directions on the site:
GET Data empty
POST Data
_token "q0D8fhwFz016k9XtmOIsAP0e5rPmZq0fL97nqVbN"
username "houssam.asaad"
password "xyzXYZ"
Files empty
Cookies
XSRF-TOKEN "eyJpdiI6IlBPdU1EaHZDYmR0N1dKRDgzQXBtanc9PSIsInZhbHVlIjoiTzhOb1wvNk1tUjJLWGJMMFJDeWdZZWVwdWNySUlORWd4MGhEYTloaXdzRFRWemZ2dFFlc09YaFVzdUFyb1wva1FpMUpDWFhBRWN4TEpB ▶"
hflow_session "eyJpdiI6IlJOZExlOGVaN3ZnVTYrVFQ0TWlwaHc9PSIsInZhbHVlIjoibWxKYnRYUXVXYklqOWFXOENKOWhKckI4cVUyN1B5TTlycU5pZ2lMa1k1UDlWS0UwZjRyTEFyR1hndDNqTUhPdGVzU2RRZUJBQ1lkT2hQ ▶"
Hi,
I used openldap to users login authentication in my old app , it's Ok with this informations : ldap_host = "ldap.hiat.edu.lb" ldap_domain = "hiat.edu.lb" ldap_binddn = "cn=manager,dc=hiat,dc=lb" ldap_bindpwd = "my_ldap_passwd" ldap_rootdn = "dc=hiat,dc=lb" ldap_searchattr = "uid" ldap_fname = "givenname" ldap_lname = "sn" ldap_uname = "uid" ldap_email_add = "mail" ldap_phone = "telephonenumber" ldap_context = "dn" ldap_uidnumber = "uidnumber"
This was good When I tried to moved the app to laravel and use adldap2-laravel, I used the same information in <.env> file and i wrote in LoginController.php file and I followed all directions on the site:
protected function attemptLogin(Request $request) { $credentials = $request->only($this->username(), 'password'); $username = $credentials[$this->username()]; $password = $credentials['password'];
$user_format = env('ADLDAP_USER_FORMAT', 'cn=%s,'.env('ADLDAP_BASEDN', '')); $userdn = sprintf($user_format, $username);
if(Adldap::auth()->attempt($userdn, $password, $bindAsUser = true)) {
$user = \App\User::where($this->username(), $username) -> first(); if (!$user) {
$user = new \App\User(); $user->username = $username; $user->password = ''; // in sync with the LDAP server $sync_attrs = $this->retrieveSyncAttributes($username); foreach ($sync_attrs as $field => $value) { $user->$field = $value !== null ? $value : ''; } } $this->guard()->login($user, true); return true; } // log error return false; }
I get
Adldap \ Auth \ BindException (49) Invalid credentials
what's problems? hire is Environment & details:
GET Data empty POST Data _token "q0D8fhwFz016k9XtmOIsAP0e5rPmZq0fL97nqVbN" username "houssam.asaad" password "xyzXYZ" Files empty Cookies XSRF-TOKEN "eyJpdiI6IlBPdU1EaHZDYmR0N1dKRDgzQXBtanc9PSIsInZhbHVlIjoiTzhOb1wvNk1tUjJLWGJMMFJDeWdZZWVwdWNySUlORWd4MGhEYTloaXdzRFRWemZ2dFFlc09YaFVzdUFyb1wva1FpMUpDWFhBRWN4TEpB ▶" hflow_session "eyJpdiI6IlJOZExlOGVaN3ZnVTYrVFQ0TWlwaHc9PSIsInZhbHVlIjoibWxKYnRYUXVXYklqOWFXOENKOWhKckI4cVUyN1B5TTlycU5pZ2lMa1k1UDlWS0UwZjRyTEFyR1hndDNqTUhPdGVzU2RRZUJBQ1lkT2hQ ▶"
Session empty Server/Request Data REDIRECT_STATUS "200" HTTP_HOST "localhost" HTTP_USER_AGENT "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" HTTP_ACCEPT "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8" HTTP_ACCEPT_LANGUAGE "en-US,en;q=0.5" HTTP_ACCEPT_ENCODING "gzip, deflate" HTTP_REFERER "http://localhost/hflwo/public/login" CONTENT_TYPE "application/x-www-form-urlencoded" CONTENT_LENGTH "91" HTTP_COOKIE "XSRF-TOKEN=eyJpdiI6IlBPdU1EaHZDYmR0N1dKRDgzQXBtanc9PSIsInZhbHVlIjoiTzhOb1wvNk1tUjJLWGJMMFJDeWdZZWVwdWNySUlORWd4MGhEYTloaXdzRFRWemZ2dFFlc09YaFVzdUFyb1wva1FpMUpDW ▶" HTTP_CONNECTION "keep-alive" HTTP_UPGRADE_INSECURE_REQUESTS "1" PATH "C:\app\houssam...CLS Client\;C:\W ▶" SystemRoot "C:\Windows" COMSPEC "C:\cmd.exe" PATHEXT ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" WINDIR "C:\Windows" SERVER_SIGNATURE "" SERVER_SOFTWARE "Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.1" SERVER_NAME "localhost" SERVER_ADDR "127.0.0.1" SERVER_PORT "80" REMOTE_ADDR "127.0.0.1" DOCUMENT_ROOT "D:/AppServ/www" REQUEST_SCHEME "http" CONTEXT_PREFIX "" CONTEXT_DOCUMENT_ROOT "D:/AppServ/www" SERVER_ADMIN "admin" SCRIPT_FILENAME "D:/AppServ/www/hit/public/index.php" REMOTE_PORT "54400" REDIRECT_URL "/hit/public/login" GATEWAY_INTERFACE "CGI/1.1" SERVER_PROTOCOL "HTTP/1.1" REQUEST_METHOD "POST" QUERY_STRING "" REQUEST_URI "/hit/public/login" SCRIPT_NAME "/hit/public/index.php" PHP_SELF "/hit/public/index.php" REQUEST_TIME_FLOAT 1524131511.852 REQUEST_TIME 1524131511 APP_NAME "hit" APP_ENV "local" APP_KEY "base64:N2YUJ4kB4WExUKfSHdmDBag2Ys3xplsguh24va7Xz4I=" APP_DEBUG "true" APP_LOG_LEVEL "debug" APP_URL "http://localhost:8000" DB_CONNECTION "mysql" DB_HOST "127.0.0.1" DB_PORT "3306" DB_DATABASE "hit" DB_USERNAME "mysql_root" DB_PASSWORD "mysql_passwd" BROADCAST_DRIVER "log" CACHE_DRIVER "file" SESSION_DRIVER "file" SESSION_LIFETIME "120" QUEUE_DRIVER "sync" REDIS_HOST "127.0.0.1" REDIS_PASSWORD "null" REDIS_PORT "6379" MAIL_DRIVER "smtp" MAIL_HOST "my_smtp" MAIL_PORT "2525" MAIL_USERNAME "null" MAIL_PASSWORD "null" MAIL_ENCRYPTION "null" PUSHER_APP_ID "" PUSHER_APP_KEY "" PUSHER_APP_SECRET "" PUSHER_APP_CLUSTER "mt1" ADLDAP_CONTROLLERS "ldap.hiat.edu.lb" ADLDAP_ADMIN_USERNAME "cn=manager,dc=hiat,dc=lb" ADLDAP_ADMIN_PASSWORD "my_ldap_passwd" ADLDAP_BASEDN "ou=Users,dc=hiat,dc=lb" ADLDAP_USER_ATTRIBUTE "uid" ADLDAP_USER_FORMAT "uid=%s,dc=hiat,dc=lb"
Environment Variables APP_NAME "hitflow" APP_ENV "local" APP_KEY "base64:N2YUJ4kB4WExUKfSHdmDBag2Ys3xplsguh24va7Xz4I=" APP_DEBUG "true" APP_LOG_LEVEL "debug" APP_URL "http://localhost:8000" DB_CONNECTION "mysql" DB_HOST "127.0.0.1" DB_PORT "3306" DB_DATABASE "hit" DB_USERNAME "mysql_root" DB_PASSWORD "mysql_passwd" BROADCAST_DRIVER "log" CACHE_DRIVER "file" SESSION_DRIVER "file" SESSION_LIFETIME "120" QUEUE_DRIVER "sync" REDIS_HOST "127.0.0.1" REDIS_PASSWORD "null" REDIS_PORT "6379" MAIL_DRIVER "smtp" MAIL_HOST "my_smtp" MAIL_PORT "2525" MAIL_USERNAME "null" MAIL_PASSWORD "null" MAIL_ENCRYPTION "null" PUSHER_APP_ID "" PUSHER_APP_KEY "" PUSHER_APP_SECRET "" PUSHER_APP_CLUSTER "mt1" ADLDAP_CONTROLLERS "ldap.hiat.edu.lb" ADLDAP_ADMIN_USERNAME "cn=manager,dc=hiat,dc=lb" ADLDAP_ADMIN_PASSWORD "my_passwd" ADLDAP_BASEDN "ou=Users,dc=hiat,dc=edu,dc=lb" ADLDAP_USER_ATTRIBUTE "uid" ADLDAP_USER_FORMAT "uid=%s,dc=hiat,dc=lb" Registered Handlers
thank you for your helps ...!