Skip to main content

单点登录 (SSO)

¥Single Sign-On (SSO)

EnterpriseThis feature is available with an Enterprise plan. SSOThis feature is available with the SSO add-on.

可以在 Strapi 应用上提供单点登录 (SSO) 功能,以允许管理员通过身份提供者(例如 Microsoft Azure Active Directory)进行身份验证。

¥The Single Sign-On (SSO) feature can be made available on a Strapi application to allow administrators to authenticate through an identity provider (e.g. Microsoft Azure Active Directory).

功能的身份证

计划:企业计划,或增长计划的 SSO 附加组件。
角色和权限:在角色 > 设置中读取和更新权限 - 单点登录。
激活:默认情况下禁用。
环境:在开发和生产环境中均可用。

¥ Plan: Enterprise plan, or SSO add-on with the Growth plan.
Role & permission: Read & Update permissions in Roles > Settings - Single Sign-On.
Activation: Disabled by default.
Environment: Available in both Development & Production environment.

Login pageLogin page

配置

¥Configuration

SSO 的常规设置在管理面板中可用,并且可以通过 Strapi 项目的代码配置其他 SSO 提供程序。

¥General settings for SSO are available in the admin panel, and additional SSO providers can be configured via your Strapi project's code.

管理面板设置

¥Admin panel settings

配置功能的路径: 全局设置 > 单点登录

¥Path to configure the feature: Global settings > Single Sign-On

  1. 在单点登录界面中,定义你选择的新设置:

    ¥In the Single Sign-On interface, define your chosen new settings:

设置名称指示
自动注册单击 True 可在 SSO 登录与现有 Strapi 管理员账户不匹配时自动创建新的 Strapi 管理员。如果此设置设置为 False,则必须事先手动创建新的 Strapi 管理员账户。
默认角色从下拉列表中选择默认情况下通过 SSO 登录自动注册的 Strapi 管理员的角色。
本地认证锁定在下拉列表中选择禁用本地身份验证功能的角色(参见 用户和权限功能 文档)。
本地身份验证被锁定的用户将被迫使用 SSO 登录,并且无法更改或重置密码。
  1. 单击“保存”按钮。

    ¥Click the Save button.

危险

不要在本地身份验证锁定的角色列表中选择超级管理员。如果选择超级管理员,则可能会意外地将自己完全锁定在 Strapi 管理面板之外。我们将很快提供修复程序。

¥Don't select Super Admin in the roles list for the Local authentication lock-out. If Super Admin is selected, it becomes possible to accidentally lock oneself out of the Strapi admin panel entirely. A fix will be provided soon.

同时,如果超级管理员无法登录,唯一的登录方法是暂时完全禁用 SSO 功能,使用用户名和密码登录以从本地身份验证锁定列表中删除超级管理员角色,然后 然后重新启用 SSO。

¥In the meantime, the only way to get in if the Super Admin can't log in is to temporarily disable the SSO feature entirely, log in with username and password to remove the Super Admin role from the Local authentication lock-out list, and then re-enable SSO.

SSO settingsSSO settings

基于代码的配置

¥Code-based configuration

SSO 配置位于 /config/admin 文件 中。以下专用指南将帮助你为 Strapi 管理面板配置其他登录和注册方法:

¥The SSO configuration lives in the /config/admin file. The following dedicated guide will help you configure additional sign-in and sign-up methods for the Strapi admin panel:

用法

¥Usage

要使用特定提供商访问管理面板,而不是使用常规 Strapi 管理员账户登录:

¥To access the admin panel using a specific provider instead of logging in with a regular Strapi administrator account:

  1. 转至 Strapi 应用管理面板的 URL。

    ¥Go to the URL of your Strapi application's admin panel.

  2. 单击所选提供商,其徽标应显示在登录表单的底部。如果你看不到你的提供商,请单击 按钮以访问所有可用提供商的完整列表。

    ¥Click on a chosen provider, which logo should be displayed at the bottom of the login form. If you cannot see your provider, click the button to access the full list of all available providers.

  3. 你将被重定向到提供者自己的登录页面,你可以在其中进行身份验证。

    ¥You will be redirected to your provider's own login page where you will be able to authenticate.