应用设置参考
本页描述了 Casdoor 管理控制台中应用编辑页面的每个字段。该页面有八个选项卡,字段按选项卡及页面顺序列出。
基础
| Field | 描述 |
|---|---|
| Name | Internal application name. |
| Display name | Name shown to users. |
| Category | Default (web apps) or Agent (M2M, e.g. MCP servers, API clients). |
| Type | For Default: All, OIDC, OAuth, SAML, CAS. 对于 Agent:MCP、A2A。 |
| Is shared | Whether the app is shared across organizations (global admin only). |
| Logo | Branding image on the sign-in and sign-up pages (URL + preview). |
| Enable dark logo | Shows Logo dark. Turning it off clears Logo dark. |
| Logo dark | Logo that the sign-in, sign-up, and other authentication pages show in the dark theme (URL + preview on a black background). Casdoor never takes it from the organization. Without it, the pages show Logo in the dark theme too. The organization has its own Logo dark for the sidebar of the admin console. |
| Title | Page title shown on the sign-in and sign-up pages. |
| Favicon | Browser tab icon (URL + preview). |
| Home | Application homepage URL. |
| Description | Short description of the application. |
| Organization | Owning organization. |
| Tags | Only users with one of these tags can sign in. 查看应用标签。 |
| Order | Sort order in lists. |
| Menu mode | Layout of the edit page navigation: Horizontal or Vertical. |
身份验证
| Field | Description |
|---|---|
| Cookie expire | Session cookie lifetime in hours (default: 720). 不含 "Remember me", 该会话是 capped 在 24 h regardless。 |
| Sliding session | 在用户持续使用时延长会话,而不是在登录后 Cookie expire 小时后结束会话。参见 滑动会话。 |
| Default group | Group automatically assigned to new users signing up through this application, including both direct sign-up and OAuth-based registration. 提供商和邀请可覆盖此每注册设置:生效的组遵循优先级邀请 SignupGroup>提供商 SignupGroup>应用默认组。 |
| Default tag | Tag automatically assigned to new users who sign up through this application. |
| Enable signup | Allow new accounts: on the signup page, by magic link or verification code, and on the first sign-in with one of the application's providers (whose Can signup is on). 当关闭, 仅 admins 可创建 accounts。 |
| Disable self signup | Shown when Enable signup is on. Users can no longer sign themselves up on the signup page, by magic link or by verification code, and the sign-in page hides the sign-up link. The signup page still works with an invitation code from an admin, and the first sign-in with a provider still creates the account. Use it to close public signup while keeping just-in-time accounts for SSO, e.g. new employees signing in with Lark or DingTalk for the first time. |
| Disable signin | Disable all sign-in for this application. |
| Enable guest signin | Allow unauthenticated guest access by presenting code=guest-user to the token endpoint. 需要 启用注册 以被开启作为 well。不适用于内置组织。请参阅访客身份验证。 |
| Enable exclusive signin | Limit the number of active sessions of each user in this application. A new sign-in ends the older sessions and expires their tokens. See Allow one session per user. |
| Max sessions | Shown when Enable exclusive signin is on. The number of sessions a user may keep in the application, 1 by default. |
| Signin session | Enable persistent sign-in session across browser restarts. |
| Auto signin | Automatically sign the user back in on revisit. 需要 登录会话 以被已启用第一。 |
| Enable Email linking | Allow linking OAuth accounts to existing accounts by matching email. |
| Signup URL | External sign-up URL, replaces Casdoor's built-in sign-up page. |
| Signin URL | External sign-in URL, replaces Casdoor's built-in sign-in page. |
| Forget URL | Custom password recovery URL. |
| Affiliation URL | Affiliation or invitation URL. |
OIDC/OAuth
| Field | Description |
|---|---|
| Client ID | OAuth 2.0 client identifier. |
| Client secret | OAuth 2.0 客户端密钥。Copy 用于复制,Regenerate 用于填入新密钥并可让旧密钥在一段时间内继续有效。参见 轮换客户端密钥。 |
| Previous client secret | 当由 Regenerate 替换的密钥仍被接受时显示,包含其停止工作的时间和 Stop accepting it 按钮。存储在 previousClientSecret 和 previousClientSecretExpireTime 中。 |
| Redirect URLs | Allowed redirect URLs after sign-in. Casdoor checks them for the authorization code flow, the implicit flow, and the CAS service parameter. See Redirect URL matching. |
| Forced redirect origin | When set, Casdoor forces all redirects to this origin. |
| Grant types | Enabled OAuth grant types: Authorization Code, Password, Client Credentials, Token, ID Token, Refresh Token, Device Code, Token Exchange, JWT Bearer. |
| Scopes | Custom scopes for Agent-category apps (name, display name, description); exposed in OIDC discovery. |
| Federated credentials | External OpenID Connect (OIDC) issuers whose tokens Casdoor accepts as a credential of this application, without a client secret. Each row has Issuer, JWKS URL, Subject, Audience, User, and Enable signup, which creates the mapped user on its first sign-in. See Federated credentials. |
| Token format | JWT, JWT-Empty, JWT-Custom, or JWT-Standard. A new application gets the Default token format of its organization. 请参阅令牌概览。 |
| Token signing method | Signing algorithm: RS256, RS512, ES256, ES384, or ES512. |
| Token group format | How the groups claim of every token format and the groups of /api/userinfo name each group: ID (org/group) (the default), Path (org/parent/group), or Name (group). Path replaces the removed useGroupPathInToken setting of conf/app.conf. |
| Token fields | User fields included in the token payload (available when format is JWT-Custom). 这个列表同时也是 /userinfo 接口的白名单:非空时只返回列出的字段。留空则包含全部字段。 A new application gets the Default token fields of its organization. 请参阅令牌概览。 |
| Token attributes | Custom claims added to the token (available when format is JWT-Custom). Each row has a Category, Value, and Type. See Token attributes |
| Token expire | Access token lifetime in hours. |
| Refresh token expire | Refresh token lifetime in hours. |
Token中包含的属性
Token attributes 的每一行都会向令牌添加一个自定义声明,并包含一个 Category、一个 Value 和一个 Type:
| Category | Value | Result |
|---|---|---|
Static Value | A template string. It supports ${user.xxx} substitution | Type sets whether the claim is a String or an Array |
Existing Field | 列表中的用户字段:Owner、Name、Id、DisplayName、Avatar、Email、Phone、Tag、Roles、Permissions、permissionNames 或 Groups。以 Properties.<key> 形式引用属性映射的键 | Casdoor 在签发令牌时从用户读取该字段 |
重定向 URL 匹配
当重定向 URL 等于 Redirect URLs 中的条目,或根据以下规则与某个条目匹配时,Casdoor 接受该 URL:
| Entry | Matches |
|---|---|
A full URL, such as https://example.com/callback | The same scheme, port, and path. The host is the same host or a subdomain of it, so the entry also allows https://api.example.com/callback. |
A loopback URL, such as http://localhost/callback or http://127.0.0.1/callback | The same URL on any port, as RFC 8252 requires for native applications. |
A host without a scheme, such as example.com or example.com/callback | http and https URLs on the host or its subdomains, with the path of the entry, or with any path if the entry has none. .example.com matches only the subdomains. |
| Anything else | The entry is a regular expression that must match the whole URL. |
Casdoor 始终拒绝 javascript:、data: 和 vbscript: URL。localhost、127.0.0.1 和 casdoor-authenticator URL 需要像其他 URL 一样有一个条目。
SAML
| Field | Description |
|---|---|
| SAML reply URL | Assertion Consumer Service (ACS) URL where Casdoor posts the SAML response. |
| Enable SAML compression | Compress SAML requests and responses. |
| Enable SAML C14N10 | Use C14N 1.0 canonicalization when signing SAML documents. |
| SAML C14N prefix | Namespace prefix list used for the C14N 1.0 canonicalization (applies when Enable SAML C14N10 is on; default xs). |
| Use Email as NameID | Use the user's email address as the SAML NameID instead of username. |
| Enable SAML POST binding | Use HTTP POST binding instead of Redirect binding. |
| SAML hash algorithm | Signature hash algorithm: SHA1, SHA256, or SHA512. |
| Disable SAML attributes | Send only NameID in the assertion, omit all other user attributes. |
| Enable SAML assertion signature | Sign the assertion element in addition to the response envelope. |
| SAML attributes | Custom attribute statements included in the SAML assertion (available when Disable SAML attributes is off). |
| SAML metadata | Read-only XML metadata for this application; includes a button to copy the metadata URL. |
提供商
| Field | Description |
|---|---|
| Providers | OAuth, email, SMS, storage, and other providers attached to this application. 控制可用的登录方式和集成。 |
Providers 表中的每个 OAuth 和 SAML 提供商都有以下设置:
| 列 | Description |
|---|---|
| 可注册 | 允许新用户通过此提供商注册。 |
| 可登录 | 可取消关联 |
| 可取消关联 | 允许用户从其账户中取消链接此提供商。 |
| 绑定规则 | Fields used to link a new external identity to an existing Casdoor user of the organization, checked in order: the first match links the accounts. Email matches only an email address that the provider reports as verified, and only a user whose email is verified or who didn't sign up through an application. Phone matches only a verified phone number, with its country code. Name matches the username, case-insensitively. The default is Email, Phone. An empty list turns linking off. If no rule links the identity and its email or phone already belongs to another user, Casdoor refuses the sign-up. A linked user completes their multi-factor authentication (MFA) before the sign-in finishes. See How Casdoor links accounts. |
| 国家代码 | 将基于电话的提供商限制在特定国家/地区呼叫代码范围内。 |
| 已提示 | 如果用户尚未绑定此提供商,注册后显示提示,要求用户进行绑定。 |
| 注册组 | 覆盖通过此提供商注册的用户的应用程序默认组。 |
界面定制
| Field | Description |
|---|---|
| Org choice mode | How users select their organization at sign-in: None, Select (dropdown), or Input (text field). |
| Signin methods | Ordered list of sign-in methods shown on the sign-in page (e.g. Password, Verification code, WebAuthn). |
| Code signin groups | 当 Signin methods 包含 Verification code 或 Magic link 时显示。只有这些组的成员才能使用验证码或魔法链接登录。为空表示所有人可用。参见 限制验证码登录仅限特定组。 |
| Signup HTML | Custom HTML injected into the sign-up page. See Custom HTML and scripts. |
| Signin HTML | Custom HTML injected into the sign-in page. See Custom HTML and scripts. |
| Page HTML | Custom HTML injected into the page <head> (e.g. meta tags, analytics snippets, or custom styles) for all of the application's pages. A <script> element, as most analytics snippets use, runs only in applications of the built-in organization and in applications with Enable custom scripts on. Casdoor refuses scripts that an organization admin saves. To use a script in another organization, a global admin turns on Enable custom scripts and enters the HTML. See Custom HTML and scripts. |
| Signin items | Configure which fields and controls appear on the sign-in form. |
| Signup items | Configure the registration form fields (visible only when Enable signup is on). |
| Background URL | Desktop sign-in page background image (URL + preview). |
| Background URL Mobile | Mobile sign-in page background image (URL + preview). |
| Background URL Dark | 深色模式下的登录页面背景图片。 |
| More background URLs | 更多背景图片。每次访问时,会随机显示其中一张或 Background URL。 |
| Custom CSS | CSS applied to the sign-in form (desktop). |
| Custom CSS Mobile | CSS applied to the sign-in form (mobile). |
| Form position | Horizontal alignment of the sign-in form: Left, Center, Right, or Enable side panel. |
| Side panel HTML | HTML shown in the panel beside the sign-in form (visible when Form position is set to Enable side panel). |
| Theme | 使用组织主题或为该应用定义自定义主题:包括样式(Default、Dark、Document 或 Blossom)、主色调、边框圆角半径以及 Is compact。请参阅 Customize the theme。 |
| Enable custom scripts | Render the custom HTML of this application as it is, so that <script> elements run. Only a global admin can turn it on. See Custom HTML and scripts. |
| Header HTML | Custom HTML injected into the page <head> of the sign-in and sign-up pages. |
| Footer HTML | Custom HTML rendered below the sign-in and sign-up forms. The footer of the Casdoor admin console shows the Footer HTML of the default application of the signed-in user's organization, in place of "Powered by Casdoor". |
自定义 HTML 和脚本
Casdoor treats the custom HTML of an application differently depending on its organization and on Enable custom scripts:
built-in组织的应用:Casdoor 原样渲染 HTML,<script>元素会执行。- Applications of other organizations, unless Enable custom scripts is on: Casdoor removes scripts, event handlers, and other active content before it renders the HTML. Links that open in another window get
rel="noopener noreferrer".
A global admin can turn on Enable custom scripts for an application of any organization. Casdoor then renders the custom HTML of that application as it is, like for built-in, and <script> elements run. Organization admins can't turn the switch on, and while it is on, they can't change the custom HTML of the application. Only a global admin can.
这适用于 Header HTML、Page HTML、Footer HTML、Side panel HTML、Signin HTML、Signup HTML、自定义登录项以及 Text 注册项。管理控制台的页脚始终经过净化处理,即使是 built-in 也是如此。组织管理员在这些字段中可以保存的内容也有限制。请参阅组织管理员可以在自定义 HTML 和 CSS 中放置什么。
安全
| Field | Description |
|---|---|
| Token cert | Certificate used to sign tokens issued by this application. |
| Client cert | Certificate used to verify client identity. 对于双向TLS,它会验证客户端连接;对于JWT持有者授权(RFC 7523),此证书中的公钥用于验证客户端JWT断言的签名。 |
| Failed signin limit | Number of consecutive failed sign-in attempts before the account is locked. 该限制同样适用于 /api/verify-code OTP 接口:输错验证码次数过多时,会用同一个计数器和冻结时间,暂时封禁该“用户 + 目标地址”组合。 |
| Failed signin frozen time | Lock duration in minutes after hitting the failed sign-in limit. |
| Code resend timeout | Seconds a user must wait before requesting another verification code (default: 60; set to 0 for the global default). |
| IP whitelist | Comma-separated list of allowed IP addresses or CIDR ranges. 覆盖组织级允许列表。查看IP允许列表。 |
| Terms of Use | URL or path to the terms-of-use page (up to 200 characters). 可直接上传 HTML 文件,生成的 URL 将自动填充。 |
反向代理
| Field | Description |
|---|---|
| Domain | Primary domain this application is served on (e.g. blog.example.com). |
| Other domains | Additional domains that should route to this application. |
| Upstream host | Casdoor 代理请求到的后端服务地址(例如 localhost:8080)。 |
| SSL mode | TLS handling: None, HTTP, HTTPS and HTTP, or HTTPS Only. |
| SSL cert | Certificate used for HTTPS when acting as a reverse proxy. |