管理员令牌
🌐 Admin tokens
Page summary:管理员令牌用于验证对 Strapi 管理 API 的程序化访问。每个令牌的权限范围是其所有者权限的一个子集,并设计用于自动化工作流程,例如 MCP 代理、CI/CD 管道和脚本。
管理员令牌允许自动化客户端对 Strapi 管理 API 的请求进行身份验证。若要对内容 API 的请求进行身份验证,请参见 API 令牌。
🌐 Admin tokens allow automated clients to authenticate requests to the Strapi Admin API. For authenticating requests to the Content API, see API Tokens.
管理员令牌和API令牌严格分开:每种令牌在另一种令牌的路由上都会被拒绝。
🌐 Admin tokens and API tokens are strictly separated: each is rejected on the other's routes.
免费功能
默认对超级管理员激活。每个更底层的角色需要在“角色 > 设置 - 管理令牌”中显式授予权限。
默认可用并已激活
在开发和生产环境中均可用

配置
🌐 Configuration
管理员令牌完全通过管理员面板进行配置。没有基于代码的配置是专门针对管理员令牌的。适用于所有令牌类型的共享盐值和加密密钥通过你在 /config/admin 文件中的 apiToken.salt 和 apiToken.secrets.encryptionKey 设置(参见 API 令牌)。
🌐 Admin tokens are configured entirely from the admin panel. No code-based configuration is specific to Admin tokens. The shared salt and encryption key that apply to all token kinds are set via apiToken.salt and apiToken.secrets.encryptionKey in your /config/admin file (see API tokens).
配置此功能的路径: 设置 > 管理面板 > 管理员令牌
创建新的管理员令牌
🌐 Creating a new Admin token
如果你不是 Strapi 实例的超级管理员,则必须由超级管理员授予你以下权限:
🌐 If you're not the Strapi instance's super admin, the super admin must have granted you the following permissions:
- 访问管理员令牌设置页面
- 创建(生成)管理员令牌
(详情请参见 RBAC > 配置角色权限)。
-
点击 创建新的管理员令牌 按钮。
-
在令牌创建表单中,配置新的管理员令牌:
| 设置名称 | 操作说明 | | --- | --- | | 名称 | 填写令牌的名称。 | | 描述 | (可选)填写令牌的描述。 | | 令牌有效期 | 选择一个有效期:7天、30天、90天_或_无限制。 |
-
定义此令牌可以执行的管理员操作:
- 点击表单下方的选项卡以浏览权限类别。
- 使用复选框启用或禁用单独的权限。
Note当前用户没有的权限会显示为禁用状态,无法选择。应用于所有者角色的条件将显示为只读,并自动应用于令牌。
-
点击 保存 按钮。新的管理员令牌 将显示在界面顶部,并附有一个复制按钮 。

明文令牌密钥仅在创建或重新生成后立即显示一次。使内容 API 令牌密钥可持久查看的 admin.secrets.encryptionKey 配置不适用于管理员令牌。管理员令牌密钥始终仅限于令牌所有者访问,无论加密配置如何。
🌐 The plaintext token key is shown only once, immediately after creation or regeneration. The admin.secrets.encryptionKey configuration that makes Content API token keys persistently viewable does not apply to Admin tokens. Admin token keys are always restricted to the token owner, regardless of encryption configuration.
管理管理员令牌
🌐 Managing Admin tokens
管理员令牌在 设置 > 管理面板 > 管理员令牌 有专门的设置页面。管理员令牌和 API 令牌存储在同一个数据库表中(通过 kind 字段区分),但在管理面板中通过独立的界面进行管理。
管理员令牌页面显示一个 所有者 列,显示每个令牌所有者的显示名称。