定制 robrogers3/laraldap-auth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

robrogers3/laraldap-auth

Composer 安装命令:

composer require robrogers3/laraldap-auth

包简介

ldap authentication for laravel

README 文档

README

Latest Version on Packagist Software License

Drop in replacement for Laravel authentication against your ldap service.

Supporting OpenLDAP.

Install

Via Composer

$ composer require robrogers3/laraldap-auth

Usage

Add this to app.php in the services providers list

robrogers3\laradauth\LdapAuthServiceProvider::class,

Update config/auth.php

    'providers' => [
        'users' => [
           'driver' => 'ldap',
           'model' => App\User::class,
           'host' => 'host.example..com',
           'domain' => 'example.com',
           'base_dn' => 'cn=users,dc=cs-ds1-1,dc=home,dc=example,dc=com',
           'user_dn' => 'uid'
        ],
    ],

Create your database, and specify database connection options in .env and/or config/database.php

Use Artisan to make auth and migrate

Run:

php artisan make:auth

If you are using Bootstrap 3 then you can publish the views to prevent user registration.

php artisan migrate
php artisan vendor:publish --force #force cause we override those in make auth.

You may be done. Go ahead and login.

Using AES to encrypt passwords

The LDAP passwords are saved in the User table. Normally they are encrypted wih BCrypt.

There is now AES support so you can safely exchange information from other applications that require an ldap login for authentication.

With AES and a shared key, you can encrypt and decrypt passwords on either side if you share the same AES key.

Here's the changes you need to make:

  1. Add the packages HashServiceProvider to config/app.php
        /*
         * Package Service Providers...
         */
        robrogers3\laradauth\LdapAuthServiceProvider::class,
        robrogers3\laradauth\HashServiceProvider::class,

Update the config/hashing.php file like so.

    'driver' => 'aes',

    //more config here

    'aes' => [
        'key' => 'shared-secret-key'
    ]

Update your user database migration and add this column:

            $table->string('user_name');

Then update your services.php config file, like so:

    'ldap' => [
        'create-user-name' => true
    ]

Now you should be good to go.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test me not

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email robrogers@me.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 281
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固