Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description about tidb_auth_token authentication #11824

Merged
merged 12 commits into from
Nov 7, 2022
1 change: 1 addition & 0 deletions keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ Query OK, 0 rows affected (0.08 sec)
- TINYINT (R)
- TINYTEXT (R)
- TO (R)
- TOKEN_ISSUER
- TOPN (R)
- TRACE
- TRADITIONAL
Expand Down
3 changes: 2 additions & 1 deletion security-compatibility-with-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ aliases: ['/docs-cn/dev/security-compatibility-with-mysql/','/docs-cn/dev/refere

TiDB 支持多种身份验证方式。通过使用 [`CREATE USER`](/sql-statements/sql-statement-create-user.md) 语句和 [`ALTER USER`](/sql-statements/sql-statement-create-user.md) 语句,即可创建新用户或更改 TiDB 权限系统内的已有用户。TiDB 身份验证方式与 MySQL 兼容,其名称与 MySQL 保持一致。

TiDB 目前支持的身份验证方式可在以下的表格中查找到。服务器和客户端建立连接时,如要指定服务器对外通告的默认验证方式,可通过 [`default_authentication_plugin`](/system-variables.md#default_authentication_plugin) 变量进行设置。`tidb_sm3_password` 为仅在 TiDB 支持的 SM3 身份验证方式,使用该方式登录的用户需要使用 [TiDB-JDBC](https://github.com/pingcap/mysql-connector-j/tree/release/8.0-sm3)。
TiDB 目前支持的身份验证方式可在以下的表格中查找到。服务器和客户端建立连接时,如要指定服务器对外通告的默认验证方式,可通过 [`default_authentication_plugin`](/system-variables.md#default_authentication_plugin) 变量进行设置。`tidb_sm3_password` 为仅在 TiDB 支持的 SM3 身份验证方式,使用该方式登录的用户需要使用 [TiDB-JDBC](https://github.com/pingcap/mysql-connector-j/tree/release/8.0-sm3)。`tidb_auth_token` 为仅用于 TiDB Cloud 内部的基于 JWT 的认证方式。

针对 TLS 身份验证,TiDB 目前采用不同的配置方案。具体情况请参见[为 TiDB 客户端服务端间通信开启加密传输](/enable-tls-between-clients-and-servers.md)。

Expand All @@ -27,6 +27,7 @@ TiDB 目前支持的身份验证方式可在以下的表格中查找到。服务
| `caching_sha2_password` | 是(5.2.0 版本起) |
| `auth_socket` | 是(5.3.0 版本起) |
| `tidb_sm3_password` | 是(6.3.0 版本起) |
| `tidb_auth_token` | 是(6.4.0 版本起) |
| TLS 证书 | 是 |
| LDAP | 否 |
| PAM | 否 |
Expand Down
3 changes: 2 additions & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ mysql> SELECT * FROM t1;
- 作用域:GLOBAL
- 是否持久化到集群:是
- 默认值:`mysql_native_password`
- 可选值:`mysql_native_password`,`caching_sha2_password`,`tidb_sm3_password`
- 可选值:`mysql_native_password`,`caching_sha2_password`,`tidb_sm3_password`,`tidb_auth_token`
- `tidb_auth_token` 为 TiDB Cloud 内部实现,**不推荐设置为该值**。
- 服务器和客户端建立连接时,这个变量用于设置服务器对外通告的默认身份验证方式。如要了解该变量的其他可选值,参见[可用的身份验证插件](/security-compatibility-with-mysql.md#可用的身份验证插件)。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只是记录下:这个变化应该不需要体现到 TiDB v6.4.0 release notes 里,对用户看起来没有实际的作用

- 若要在用户登录时使用 `tidb_sm3_password` 插件,需要使用 [TiDB-JDBC](https://github.com/pingcap/mysql-connector-j/tree/release/8.0-sm3) 进行连接。

Expand Down
18 changes: 18 additions & 0 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,24 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/
+ 默认值:"",支持 TLSv1.1 及以上版本。
+ 可选值:`"TLSv1.0"`、`"TLSv1.1"`、`"TLSv1.2"` 和 `"TLSv1.3"`

Copy link
Collaborator

@qiancai qiancai Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只是记录下:这两个配置项变化应该不需要体现到 TiDB v6.4.0 release notes 里,对用户看起来没有实际的作用

### `auth-token-jwks` <span class="version-mark">从 v6.4.0 版本开始引入</span>

> **警告:**
>
> `tidb_auth_token` 认证方式仅用于 TiDB Cloud 内部实现,**不推荐修改该配置**。

+ 设置用于 `tidb_auth_token` 认证方式的 JWKS 的本地文件地址。
+ 默认值:""

### `auth-token-refresh-interval` <span class="version-mark">从 v6.4.0 版本开始引入</span>

> **警告:**
>
> `tidb_auth_token` 认证方式仅用于 TiDB Cloud 内部实现,**不推荐修改该配置**。

+ 设置用于 `tidb_auth_token` 认证方式的 JWKS 刷新时间间隔。
+ 默认值:1h

## performance

性能相关配置。
Expand Down