LaravelPackages.net
Acme Inc.
Toggle sidebar
krenuser/ldap-auth

Basic readonly authentication via LDAP for Laravel 6+

9
1
3.0.2
About krenuser/ldap-auth

krenuser/ldap-auth is a Laravel package for basic readonly authentication via ldap for laravel 6+. It currently has 1 GitHub stars and 9 downloads on Packagist (latest version 3.0.2). Install it with composer require krenuser/ldap-auth. Discover more Laravel packages by krenuser or browse all Laravel packages to compare alternatives.

Last updated

Latest Stable Version License

ldap-auth

Very basic READ ONLY LDAP authentication driver for Laravel 6.x+

Based on Krenor's ldap-auth repository.

Tested with Laravel v7.29.

Installation

Step 1: Install Through Composer

Add to your root composer.json and install with composer install or composer update

{
  require: {
    "krenuser/ldap-auth": "*"
  }
}

or use composer require krenuser/ldap-auth in your console.

Step 2: Add the Service Provider

Modify your config/app.php file and add the service provider to the providers array.

KrenUser\LdapAuth\LdapAuthServiceProvider::class,

Step 3: Publish the configuration file by running:

php artisan vendor:publish

Now you're all set!

Configuration

Step 1: Tweak the basic authentication

Update your config/auth.php to use ldap as authentication and the LdapUser Class.

'guards' => [
  	'web' => [
  		'driver'   => 'session',
  		'provider' => 'ldap-users',
	],
],

'providers' => [
	'users'      => [
		'driver' => 'eloquent',
		'model'  => App\User::class,
	],

	'ldap-users' => [
		'driver' => 'ldap',
		'model'  => \KrenUser\LdapAuth\Objects\LdapUser::class,
	],
]

Step 2: Adjust the LDAP config to your needs

If you have run php artisan vendor:publish you should see the
ldap.php file in your config directory. Adjust the values as you need them.

Usage

Authentication

Look up here for an Example or Look up here for all Guard methods using $this->auth.

Contributing

Pull Requests

  • PSR-2 Coding Standard

  • Add tests - Your patch won't be accepted if it doesn't have tests.

  • Document any changes - Make sure the README.md and any other relevant documentation are kept up-to-date.

  • Create feature branches - Use git checkout -b my-new-feature

  • One pull request per feature - If you want to do more than one thing, send multiple pull requests.

  • Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

Licence

ldap-auth is distributed under the terms of the MIT license

Comments