I get this error: ErrorException in LdapAuthUserProvider.php line 117: Undefined index: fieldname
my files
config/auth.php
<?php
return [
'driver' => 'ldap',
'model' => App\User::class,
'table' => 'users',
'fields' => [
'username' => 'samaccountname',
'name' => 'displayName',
'firstname' => 'givenName',
'lastname' => 'sn',
'groups' => 'memberOf',
],
'password' => [
'email' => 'emails.password',
'table' => 'password_resets',
'expire' => 60,
],
];
config/adlap.php
return [
'account_suffix' => "@inge.local",
'domain_controllers' => array("172.25.1.50", "172.25.1.51"),
'base_dn' => 'DC=ingeo,DC=local',
];
//form login
<form class="form-horizontal" role="form" method="POST" action="{{ url('/auth/login') }}">
<input type="email" class="form-control" name="email" value="{{ old('email') }}">
<input type="password" class="form-control" name="password">
<button type="submit" class="btn btn-primary">Iniciar Sesión</button>
</form>
/routes.php
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', ['as' =>'auth/login', 'uses' => 'Auth\AuthController@postLogin']);
//AuthController.php
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
/**
* Create a new authentication controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'getLogout']);
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
}
I do wrong?
I get this error: ErrorException in LdapAuthUserProvider.php line 117: Undefined index: fieldname
my files
config/auth.php
config/adlap.php
/routes.php
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', ['as' =>'auth/login', 'uses' => 'Auth\AuthController@postLogin']);
//AuthController.php
I do wrong?