Welcome to the Treehouse Community
Looking to learn something new?
Kristina Petravičiūtė11,270 Points
LDAP authentication with Laravel 5
I really need your help. I'm trying to connect my laravel 5 project with Active directory, but I'm getting error message: "BadMethodCallException in Validator.php line 2615: Method [validateName] does not exist.".
This is my steps:
I'm using ccovey/ldap-auth so I install them by typing composer require "ccovey/ldap-auth": "1.1.*"
Open config/app.php and find Illuminate\Auth\AuthServiceProvider and replace it with Ccovey\LdapAuth\LdapAuthServiceProvider
Edit auth.php file by changing driver to ldap and add 'username_field' => 'fieldname'
Creating adldap.php file (I changed real names to example, com, name and password for security purposes):
<?php return [ 'account_suffix' => "@example.com", 'domain_controllers' => array("dc1.example.com"), // An array of domains may be provided for load balancing. 'base_dn' => 'DC=example,DC=com', 'admin_username' => 'name', 'admin_password' => 'password', 'real_primary_group' => true, // Returns the primary group (an educated guess). 'use_ssl' => false, // If TLS is true this MUST be false. 'use_tls' => false, // If SSL is true this MUST be false. 'recursive_groups' => true, ];
I have connected to mssql database and have user table migration (if it's needed for authentication?)
In routes.php :
<?php Route::post('authenticate_user', array('as'=>'auth_user', 'uses'=>'HomeController@authenticateUser')); Route::controllers([ 'auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController', ]);
WHAT I'VE MISSED? HELP! Thank you :)
How are you getting on with this one? A bad method call would suggest you're trying to call something that doesn't exist. Is the validator in your error message the Illuminate Validator or an additional service?