@@ -80,26 +80,36 @@ Change the auth driver in `config/auth.php` to `adldap`:
80
80
81
81
### Usage
82
82
83
- In your login form, change the username form input name to the active directory attribute you'd like to
84
- use to retrieve users from. For example, if I'd like to login users by their email address, then use the
85
- form input name ` mail ` :
83
+ #### Username Attributes
86
84
87
- <input type="text" name="mail" />
88
-
89
- <input type="password" name="password" />
85
+ Inside your ` config/adldap_auth.php ` file there is a configuration option named ` username_attribute ` . The key of the
86
+ array indicates the input name of your login form, and the value indicates the LDAP attribute that this references.
87
+
88
+ This option just allows you to set your input name to however you see fit, and allow different ways of logging in a user.
90
89
91
- Or, use their ` samaccountname ` attribute:
90
+ In your login form, change the username form input name to your configured input name.
92
91
93
- <input type="text" name="samaccountname" />
92
+ By default this is set to ` email ` :
93
+
94
+ <input type="text" name="email" />
94
95
95
96
<input type="password" name="password" />
96
97
97
98
You'll also need to add the following to your AuthController if you're not overriding the default postLogin method.
98
99
99
- protected $username = 'samaccountname';
100
+ protected $username = 'email';
101
+
102
+ If you'd like to use the users ` samaccountname ` to login instead, just your inputs and configuration:
103
+
104
+ <input type="text" name="username" />
105
+
106
+ <input type="password" name="password" />
100
107
101
- All this name represents, is how Adldap discovers the user trying to login. The actual authentication is done
102
- with the ` login_attribute ` inside your ` config/adldap_auth.php ` file.
108
+ Inside ` config/adldap_auth.php `
109
+
110
+ 'username_attribute' => ['username' => 'samaccountname'],
111
+
112
+ > ** Note** The actual authentication is done with the ` login_attribute ` inside your ` config/adldap_auth.php ` file.
103
113
104
114
#### Logging In
105
115
0 commit comments