Adldap2 / Adldap2-Laravel

LDAP Authentication & Management for Laravel
MIT License
911 stars 184 forks source link

These credentials do not match our records #376

Open narenbimal opened 6 years ago

narenbimal commented 6 years ago

Description:

I am using OpenLDAP server My adldap.php

<?php

return [
    'connections' => [

        'default' => [
            'auto_connect' => true,
            'connection' => Adldap\Connections\Ldap::class,
            'schema' => Adldap\Schemas\OpenLDAP::class,
            'connection_settings' => [
                'account_prefix' => env('ADLDAP_ACCOUNT_PREFIX', 'XX'),
                'account_suffix' => env('ADLDAP_ACCOUNT_SUFFIX', 'XX'),
                'domain_controllers' => explode(' ', env('ADLDAP_CONTROLLERS', 'XX')),
                'port' => env('ADLDAP_PORT', 389),
                'timeout' => env('ADLDAP_TIMEOUT', 5),
                'base_dn' => env('ADLDAP_BASEDN', 'XX'),
                'admin_account_suffix' => env('ADLDAP_ADMIN_ACCOUNT_SUFFIX', ''),
                'admin_username' => env('ADLDAP_ADMIN_USERNAME', ''),
                'admin_password' => env('ADLDAP_ADMIN_PASSWORD', ''),
                'follow_referrals' => false,
                'use_ssl' => false,
                'use_tls' => false,
            ],
        ],
    ],
];

adldap_auth.php

<?php

return [
    'connection' => env('ADLDAP_CONNECTION', 'default'),
    'provider' => Adldap\Laravel\Auth\DatabaseUserProvider::class,
    'resolver' => Adldap\Laravel\Auth\Resolver::class,
    'importer' => Adldap\Laravel\Auth\Importer::class,
    'rules' => [
        Adldap\Laravel\Validation\Rules\DenyTrashed::class,
    ],
    'scopes' => [
        Adldap\Laravel\Scopes\UpnScope::class,
    ],

    'usernames' => [
        'ldap' => 'cn',
        'eloquent' => 'username',
    ],
    'login_fallback' => env('ADLDAP_LOGIN_FALLBACK', false),
    'password_sync' => env('ADLDAP_PASSWORD_SYNC', false),
    'windows_auth_attribute' => ['samaccountname' => 'AUTH_USER'],
    'sync_attributes' => [
        'username' => 'cn',
        'password' => 'userPassword',
    ],
];

Steps To Reproduce:

when I use web form it gives These credentials do not match our records if I put {{ dd(Adldap::auth()->attempt('xx','xx')) }} in login.blade.php, it works fine

Any help??

narenbimal commented 6 years ago

uploaded_file.txt