You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/ldap-authentication.md
+120-128
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,6 @@ individuals, groups, and organizations.
8
8
9
9
*Percona Server for MySQL* 8.0.30-22 implements an SASL-based LDAP authentication plugin. This plugin only supports the SCRAM-SHA-1 SASL mechanism.
10
10
11
-
!!! important
12
-
13
-
--8<--- "tech.preview.md:5:5"
14
-
15
11
*Percona Server for MySQL* 8.0.19-10 implements the simple LDAP authentication. The Percona simple LDAP authentication plugin is a free and Open Source implementation of the MySQL Enterprise Simple LDAP authentication plugin.
16
12
17
13
## Plugin names and file names
@@ -114,12 +110,6 @@ Install the plugin with the following statements.
To set and persist values at runtime, use the following statements:
118
-
119
-
```{.bash data-prompt="mysql>"}
120
-
mysql> SET PERSIST authentication_ldap_simple_server_host='127.0.0.1';
121
-
mysql> SET PERSIST authentication_ldap_simple_bind_base_dn='dc=percona, dc=com';
122
-
```
123
113
124
114
=== "Load the SASL-based LDAP authentication plugin"
125
115
@@ -134,130 +124,134 @@ Install the plugin with the following statements.
134
124
mysql> SET PERSIST authentication_ldap_sasl_bind_base_dn='dc=percona, dc=com';
135
125
```
136
126
137
-
## Create a user using simple LDAP authentication
127
+
## Create a user
138
128
139
129
There are several methods to add or modify a user.
140
130
141
-
=== "Use authentication_ldap_simple plugin"
142
-
143
-
In the `CREATE USER` statement or the `ALTER USER` statement, for simple LDAP authentication, you can specify the `authentication_ldap_simple` plugin in the `IDENTIFIED WITH` clause:
131
+
=== "Using LDAP Simple authentication"
144
132
145
-
```text
146
-
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_simple;
147
-
```
148
-
149
-
Using the `IDENTIFIED WITH` clause, the database server assigns the specified plugin.
150
-
151
-
=== "Use the authentication string in simple LDAP"
152
-
153
-
If you provide the optional authentication string clause, ‘cn,ou,dc,dc’ in the example, the string is stored along with the password.
154
-
155
-
```text
156
-
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_simple BY 'cn=[user name],ou=[organization unit],dc=[domain component],dc=com'
157
-
```
158
-
159
-
Unless the [authentication_ldap_simple_group_role_mapping](ldap-system-variables.md#authentication_ldap_simple_group_role_mapping) variable is used, creating a user with an authentication string does not use the following system variables:
Creating the user with `IDENTIFIED BY authentication_ldap_simple` uses the variables.
133
+
There are several methods to add or modify a user.
134
+
135
+
=== "Use authentication_ldap_simple plugin"
136
+
137
+
In the `CREATE USER` statement or the `ALTER USER` statement, for simple LDAP authentication, you can specify the `authentication_ldap_simple` plugin in the `IDENTIFIED WITH` clause:
138
+
139
+
```text
140
+
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_simple;
141
+
```
142
+
143
+
Using the `IDENTIFIED WITH` clause, the database server assigns the specified plugin.
144
+
145
+
=== "Use the authentication string in simple LDAP"
146
+
147
+
If you provide the optional authentication string clause, ‘cn,ou,dc,dc’ in the example, the string is stored along with the password.
148
+
149
+
```text
150
+
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_simple BY 'cn=[user name],ou=[organization unit],dc=[domain component],dc=com'
151
+
```
152
+
153
+
Unless the [authentication_ldap_simple_group_role_mapping](ldap-simple-variables.md#authentication_ldap_simple_group_role_mapping) variable is used, creating a user with an authentication string does not use the following system variables:
Creating the user with `IDENTIFIED BY authentication_ldap_simple` uses the variables.
166
+
167
+
Creating the user with the [authentication_ldap_simple_group_role_mapping](ldap-simple-variables.md#authentication_ldap_simple_group_role_mapping) variable also adds the [authentication_ldap_simple_bind_root_dn](ldap-simple-variables.md#authentication_ldap_simple_bind_root_dn) and [authentication_ldap_simple_bind_root_pwd](ldap-simple-variables.md#authentication_ldap_simple_bind_root_pwd) variables.
168
+
169
+
=== "Using SASL-based LDAP authentication"
170
+
171
+
There are several methods to add or modify a user.
172
+
173
+
=== "Use authentication_ldap_sasl plugin"
174
+
175
+
For SASL-based LDAP authentication, in the `CREATE USER` statement or the `ALTER USER` statement, you can specify the `authentication_ldap_sasl` plugin:
176
+
177
+
```text
178
+
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_sasl;
179
+
```
180
+
181
+
=== "Use the authentication string in SASL-based LDAP"
182
+
183
+
If you provide the optional authentication string clause, ‘cn,ou,dc,dc’ in the example, the string is stored along with the password.
184
+
185
+
```text
186
+
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_sasl BY 'cn=[user name],ou=[organization unit],dc=[domain component],dc=com'
187
+
```
188
+
189
+
Unless the [authentication_ldap_sasl_group_role_mapping](ldap-sasl-variables.md#authentication_ldap_sasl_group_role_mapping) variable is used, creating a user with an authentication string does not use the following system variables:
Creating the user with `IDENTIFIED BY authentication_ldap_sasl` uses the variables.
202
+
203
+
Creating the user with the [authentication_ldap_sasl_group_role_mapping](ldap-sasl-variables.md#authentication_ldap_sasl_group_role_mapping) variable also adds the[authentication_ldap_sasl_bind_root_dn](ldap-sasl-variables.md#authentication_ldap_sasl_bind_root_dn) and [authentication_ldap_sasl_bind_root_pwd](ldap-sasl-variables.md#authentication_ldap_sasl_bind_root_pwd) variables.
204
+
205
+
## Examples
206
+
207
+
The following sections are examples of using simple LDAP authentication and SASL-based LDAP authentication.
208
+
209
+
For the purposes of this example, we use the following LDAP user:
172
210
173
-
Creating the user with the [authentication_ldap_simple_group_role_mapping](ldap-system-variables.md#authentication_ldap_simple_group_role_mapping) variable also adds the [authentication_ldap_simple_bind_root_dn](ldap-system-variables.md#authentication_ldap_simple_bind_root_dn) and [authentication_ldap_simple_bind_root_pwd](ldap-system-variables.md#authentication_ldap_simple_bind_root_pwd) variables.
174
-
175
-
## Create a user using SASL-based LDAP authentication
176
-
177
-
There are several methods to add or modify a user.
178
-
179
-
=== "Use authentication_ldap_sasl plugin"
180
-
181
-
For SASL-based LDAP authentication, in the `CREATE USER` statement or the `ALTER USER` statement, you can specify the `authentication_ldap_sasl` plugin:
182
-
183
-
```text
184
-
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_sasl;
185
-
```
186
-
187
-
=== "Use the authentication string in SASL-based LDAP"
188
-
189
-
If you provide the optional authentication string clause, ‘cn,ou,dc,dc’ in the example, the string is stored along with the password.
190
-
191
211
```text
192
-
mysql> CREATE USER ... IDENTIFIED WITH authentication_ldap_sasl BY 'cn=[user name],ou=[organization unit],dc=[domain component],dc=com'
212
+
uid=ldapuser,ou=testusers,dc=percona,dc=com
193
213
```
194
-
195
-
Unless the [authentication_ldap_sasl_group_role_mapping](ldap-system-variables.md#authentication_ldap_sasl_group_role_mapping) variable is used, creating a user with an authentication string does not use the following system variables:
Creating the user with `IDENTIFIED BY authentication_ldap_sasl` uses the variables.
208
214
209
-
Creating the user with the [authentication_ldap_sasl_group_role_mapping](ldap-system-variables.md#authentication_ldap_sasl_group_role_mapping) variable also adds the[authentication_ldap_sasl_bind_root_dn](ldap-system-variables.md#authentication_ldap_sasl_bind_root_dn) and [authentication_ldap_sasl_bind_root_pwd](ldap-system-variables.md#authentication_ldap_sasl_bind_root_pwd) variables.
210
-
211
-
## Examples
212
-
213
-
The following sections are examples of using simple LDAP authentication and SASL-based LDAP authentication.
214
-
215
-
For the purposes of this example, we use the following LDAP user:
216
-
217
-
```text
218
-
uid=ldapuser,ou=testusers,dc=percona,dc=com
219
-
```
220
-
221
-
=== "Simple LDAP authentication"
222
-
223
-
The following example configures an LDAP user and connects to the database server.
224
-
225
-
Create a database server account for `ldapuser` with the following statement:
226
-
227
-
```{.bash data-prompt="mysql>"}
228
-
mysql> CREATE USER 'ldapuser'@'localhost' IDENTIFIED WITH authentication_ldap_simple BY 'uid=ldapuser,ou=testusers,dc=percona,dc=com';
229
-
```
230
-
231
-
The authentication string does not include the LDAP password. This password must be provided by the client user when they connect.
232
-
233
-
```{.bash data-prompt="mysql>"}
234
-
mysql> mysql --user=ldapuser --password --enable-cleartext-plugin
235
-
```
236
-
237
-
The user enters the `ldapuser` password. The client sends the password as cleartext, which is necessary when using a server-side LDAP library without SASL. The following actions may minimize the risk:
238
-
239
-
* Require that the database server clients explicitly enable the `mysql_clear_password` plugin with `--enable-cleartext-plugin`.
240
-
* Require that the database server clients connect to the database server using an encrypted connection
241
-
242
-
=== "SASL-based LDAP authentication"
243
-
244
-
The following example configures an LDAP user and connect to the database server.
245
-
246
-
Create a database server account for `ldapuser` with the following statement:
247
-
248
-
```{.bash data-prompt="mysql>"}
249
-
mysql> CREATE USER 'ldapuser'@'localhost' IDENTIFIED WITH authentication_ldap_sasl AS 'uid=ldapuser,ou=testusers,dc=percona,dc=com';
250
-
```
251
-
252
-
The authentication string does not include the LDAP password. This password must be provided by the client user when they connect.
253
-
254
-
Clients connect ot the database server by providing the database server user name and LDAP password:
255
-
256
-
```{.bash data-prompt="mysql>"}
257
-
mysql> mysql --user=ldapuser --password
258
-
```
259
-
260
-
The authentication is similar to the authentication method used by simple LDAP authentication, except that the client and the database server SASL LDAP plugins use SASL messages. These messages are secure within the LDAP protocol.
215
+
=== "Simple LDAP authentication"
216
+
217
+
The following example configures an LDAP user and connects to the database server.
218
+
219
+
Create a database server account for `ldapuser` with the following statement:
220
+
221
+
```{.bash data-prompt="mysql>"}
222
+
mysql> CREATE USER 'ldapuser'@'localhost' IDENTIFIED WITH authentication_ldap_simple BY 'uid=ldapuser,ou=testusers,dc=percona,dc=com';
223
+
```
224
+
225
+
The authentication string does not include the LDAP password. This password must be provided by the client user when they connect.
226
+
227
+
```{.bash data-prompt="mysql>"}
228
+
mysql> mysql --user=ldapuser --password --enable-cleartext-plugin
229
+
```
230
+
231
+
The user enters the `ldapuser` password. The client sends the password as cleartext, which is necessary when using a server-side LDAP library without SASL. The following actions may minimize the risk:
232
+
233
+
* Require that the database server clients explicitly enable the `mysql_clear_password` plugin with `--enable-cleartext-plugin`.
234
+
* Require that the database server clients connect to the database server using an encrypted connection
235
+
236
+
=== "SASL-based LDAP authentication"
237
+
238
+
The following example configures an LDAP user and connect to the database server.
239
+
240
+
Create a database server account for `ldapuser` with the following statement:
241
+
242
+
```{.bash data-prompt="mysql>"}
243
+
mysql> CREATE USER 'ldapuser'@'localhost' IDENTIFIED WITH authentication_ldap_sasl AS 'uid=ldapuser,ou=testusers,dc=percona,dc=com';
244
+
```
245
+
246
+
The authentication string does not include the LDAP password. This password must be provided by the client user when they connect.
247
+
248
+
Clients connect ot the database server by providing the database server user name and LDAP password:
249
+
250
+
```{.bash data-prompt="mysql>"}
251
+
mysql> mysql --user=ldapuser --password
252
+
```
253
+
254
+
The authentication is similar to the authentication method used by simple LDAP authentication, except that the client and the database server SASL LDAP plugins use SASL messages. These messages are secure within the LDAP protocol.
261
255
262
256
### Uninstall the plugins
263
257
@@ -271,8 +265,6 @@ If you installed either plugin at [server startup](#load-the-plugins-at-server-s
0 commit comments