Open ArturKami opened 7 years ago
i managed to get users by :
$models = Adldap::search()->all(); dd($models);
i got this :
but when i try
$users = Adldap::search()->users()->get(); dd($users);
i get empty array :
I changed shema in file config/adldap.php
from :
'schema' => Adldap\Schemas\ActiveDirectory::class,
set this:
'schema'
=> Adldap\Schemas\OpenLDAP::class,
and searching :
$users = Adldap::search()->users()->get(); dd($users);
works :
Hi @ArturKami,
First thing, you need to switch schemas in your configuration from:
'Schema' => Adldap\Schemas\ActiveDirectory::class,
To:
'Schema' => Adldap\Schemas\OpenLDAP::class,
There may be more issues, but I'm currently on my cellphone so I'll take another look in a moment.
Thank you for your response !!
I changed shema in file config/adldap.php from : 'schema' => Adldap\Schemas\ActiveDirectory::class, set this: 'schema' => Adldap\Schemas\OpenLDAP::class,
and searching :
$users = Adldap::search()->users()->get(); dd($users);
now works :
But dd(Adldap::auth()->attempt('a.kaminski', '*********'));
return false and localhost/login return "These credentials do not match our records."
Try commenting out the scope in your adldap_auth.php. It worked for me with a similar setup.
// Adldap\Laravel\Scopes\UpnScope::class,
donde busco esto amigo ? $users = Adldap::search()->users()->get(); dd($users);
hey @strozzascotte thanks for hint but that didint help solve the problem :(
hey @anthonycalderon i dont speak Spanish my friend but thanks to google translate "Where I am loking for this friend" :P
Answer is - i put
$users = Adldap::search()->users()->get(); dd($users);
in routes->web.php to find out if auth is working and it returns
Description:
Hi, im trying to authenticate users to OpenLDAP with your package for about week, im reading all issue's befor mine with no use.
What i manage to accomplish is to connect to LDAP and get users typing this in top of routes :
dd(Adldap::search()->where('cn', '=', 'Artur Kamiński')->get());
but when i try auth it retuns "false" : ` $mail = 'a.kaminski'; $password = '**';dd(Adldap::auth()->attempt($mail, $password)); ` one important thing my email are difrent than my domain i think that matters. I hope u can help me, thank you in advance !!
This is my config
adldap_auth.php
`<?php
return [
];`
login.blade.php
`@extends('layouts.app')
@section('content')
@endsection `
adldap.php `<?php
return [
];`
auth.php
`<?php
return [
];`
.env
ADLDAP_ACCOUNT_PREFIX='uid=' ADLDAP_ACCOUNT_SUFFIX='dc=regio,dc=local' ADLDAP_CONTROLLERS='xx.xx.xx.xx' ADLDAP_BASEDN='dc=regio,dc=local' ADLDAP_ADMIN_ACCOUNT_PREFIX='cn=' ADLDAP_ADMIN_ACCOUNT_SUFFIX='dc=regio,dc=local' ADLDAP_ADMIN_USERNAME='cuser,' ADLDAP_ADMIN_PASSWORD=xxxxxxx
.