Casdoor集成市场

authentik | 身份提供商

用 authentik 登录 Casdoor

Add authentik to Casdoor as an OpenID Connect provider, and people sign in to your Casdoor applications with the accounts, MFA and policies they already have in authentik.

Casdoor 官方核验OIDCPKCE自托管
你需要一个正在运行的 Casdoor,自己部署或用 Casdoor 云都可以。示例中的 https://auth.example.com 请换成你的 Casdoor 地址(Casdoor 云上类似 https://acme.casdoor.com),其他 example.com 地址也换成你自己的。

用 Casdoor 配置 authentik

  1. 1

    Create the application

    In the authentik admin interface, open Applications → Applications and click New Application. Name it, set the slug to casdoor, and choose OAuth2/OpenID Connect as the provider type.

  2. 2

    Configure the provider

    In the provider step, keep the client type confidential, add a strict redirect URI, and pick a signing key:

    Client typeConfidential
    Redirect URIsStrict: https://auth.example.com/callback
    Signing Keyauthentik Self-signed Certificate (or your own)
  3. 3

    Copy the credentials

    Finish the wizard, open the provider and copy its Client ID and Client Secret.

  4. 4

    在 Casdoor 中添加 authentik 提供商

    在 Casdoor 控制台打开 提供商,点击 添加,填写:

    类别OAuth
    类型OIDC
    显示名称authentik
    客户端ID<client ID>
    客户端密钥<client secret>
    Issuer链接https://authentik.example.com/application/o/casdoor/
    认证URLhttps://authentik.example.com/application/o/authorize/
    Token链接https://authentik.example.com/application/o/token/
    范围openid profile email
    UserInfo链接https://authentik.example.com/application/o/userinfo/
    登出URLhttps://authentik.example.com/application/o/casdoor/end-session/
    启用PKCE开启

    点击 Issuer链接 旁边的 请求,会从 authentik 的 discovery 文档自动填好其余地址。同一个组织里所有 OIDC 类型的提供商都通过同一个字段关联用户,所以如果这个组织已经有一个 OIDC 提供商,请把 类型 改成 Custom Flexible,它按提供商分别关联账号。

  5. 5

    把提供商加到应用上

    打开 应用,编辑用户登录的那个应用,在它的 提供商 标签页添加这个提供商。之后登录页上就会出现 authentik 按钮。

注意事项

  • The issuer of an authentik provider contains the application slug and ends with a slash, for example https://authentik.example.com/application/o/casdoor/. Casdoor compares it with the token's issuer, so the slug must match.
  • Always pick a signing key. Without one, authentik signs tokens with the client secret and publishes no keys.
  • Since authentik 2025.10, email_verified is false unless you change the email scope mapping, so Casdoor receives the email as unverified.

authentik 的设置取自它的官方文档(核对于 2026年10月:authentik OAuth2 provider)。authentik 是其所有者的商标。

常见问题

Casdoor says the issuer doesn't match. Why?

Check the slug and the trailing slash. If you set the provider's issuer mode to global, the issuer is https://authentik.example.com/ instead; put that in the provider's Issuer URL in Casdoor.

Do I need Include claims in id_token?

No. Casdoor also calls authentik's userinfo endpoint, which returns the profile and email claims.