-
Notifications
You must be signed in to change notification settings - Fork 183
feat(web): Add support for authentik sso #627
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
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request adds comprehensive support for Authentik as a new identity provider across the codebase. Changes include schema and type definitions for AuthentikIdentityProviderConfig, documentation with setup instructions, runtime provider configuration in the SSO module, and UI support through logo integration and provider information mapping. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment has been minimized.
This comment has been minimized.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/docs/configuration/idp.mdx (1)
369-416: Minor wording and example consistency tweaks for Authentik sectionThe content and flow look good. Two small polish suggestions:
- “Create a OAuth2/OpenID Connect application” → “Create an OAuth2/OpenID Connect application”.
- Step 2 says env vars “can be named whatever you like (ex. …)”, but the JSON snippet then hardcodes the example names. Consider either:
- Using generic placeholders (
YOUR_CLIENT_ID_ENV_VAR, etc.) like other sections, or- Explicitly stating that the snippet shows the recommended names and should be adjusted if different env var names are used.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/web/public/authentik.svgis excluded by!**/*.svg
📒 Files selected for processing (11)
CHANGELOG.md(1 hunks)docs/docs/configuration/idp.mdx(1 hunks)docs/snippets/schemas/v3/identityProvider.schema.mdx(2 hunks)docs/snippets/schemas/v3/index.schema.mdx(2 hunks)packages/schemas/src/v3/identityProvider.schema.ts(2 hunks)packages/schemas/src/v3/identityProvider.type.ts(2 hunks)packages/schemas/src/v3/index.schema.ts(2 hunks)packages/schemas/src/v3/index.type.ts(2 hunks)packages/web/src/ee/features/sso/sso.ts(3 hunks)packages/web/src/lib/utils.ts(2 hunks)schemas/v3/identityProvider.json(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/schemas/src/v3/identityProvider.type.ts (1)
packages/schemas/src/v3/index.type.ts (2)
GCPIAPIdentityProviderConfig(1388-1404)AuthentikIdentityProviderConfig(1405-1447)
packages/schemas/src/v3/index.type.ts (1)
packages/schemas/src/v3/identityProvider.type.ts (2)
GCPIAPIdentityProviderConfig(242-258)AuthentikIdentityProviderConfig(259-301)
🪛 LanguageTool
docs/docs/configuration/idp.mdx
[grammar] ~369-~369: Ensure spelling is correct
Context: ... ### Authentik [Auth.js Authentik Provider Docs](https:/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (14)
docs/snippets/schemas/v3/index.schema.mdx (1)
5166-5275: Authentik IdP schema variant looks consistent with existing OIDC providersThe new
AuthentikIdentityProviderConfigdefinition and itsoneOfentry mirror the existing Okta/Keycloak/Microsoft Entra ID patterns (provider"authentik", purpose"sso", andclientId/clientSecret/issuersupportingenvorgoogleCloudSecrettokens). This looks structurally correct for the config surface.Also applies to: 5921-6030
packages/web/src/ee/features/sso/sso.ts (1)
4-4: Authentik provider wiring verified as correctWeb verification confirms:
- Import path
next-auth/providers/authentikis correct for NextAuth- Provider options
{ clientId, clientSecret, issuer }are the documented configuration fieldsThe Authentik integration is properly implemented and consistent with the NextAuth/Auth.js API.
packages/schemas/src/v3/identityProvider.schema.ts (2)
1404-1513: LGTM! oneOf entry correctly includes Authentik provider.The Authentik provider entry in the oneOf union is properly structured and consistent with other providers.
649-758: Schema correctly implements Authentik OIDC configuration with issuer field.The AuthentikIdentityProviderConfig schema is consistent with the runtime implementation in
packages/web/src/ee/features/sso/sso.ts. Theissuerfield is properly retrieved from the configuration and passed tocreateAuthentikProvider(), confirming the schema supports the required OIDC flow.schemas/v3/identityProvider.json (2)
173-195: LGTM! JSON schema definition is clean and consistent.The AuthentikIdentityProviderConfig definition properly uses
$refto the shared Token type, maintaining consistency with other provider definitions in this schema.
218-221: LGTM! oneOf reference correctly added.The Authentik provider is properly included in the oneOf union, allowing it as a valid identity provider configuration variant.
packages/schemas/src/v3/identityProvider.type.ts (2)
3-11: LGTM! Union type correctly includes Authentik provider.The IdentityProviderConfig union type is properly updated to include AuthentikIdentityProviderConfig, maintaining the discriminated union pattern that allows TypeScript to narrow types based on the
providerfield.
259-301: LGTM! TypeScript interface accurately reflects the schema.The AuthentikIdentityProviderConfig interface is well-defined with:
- Literal types for
providerandpurposeenabling type narrowing- Union types for secrets supporting both environment variables and Google Cloud Secrets
- Comprehensive JSDoc documentation for all fields
packages/schemas/src/v3/index.schema.ts (2)
5165-5273: Authentik identity provider definition matches existing OIDC patternsThe new
AuthentikIdentityProviderConfigschema mirrors Okta/Keycloak/Microsoft (env/Google Cloud Secret union, required clientId/clientSecret/issuer,additionalProperties: false) and looks consistent with the typed interface. LGTM.
5920-6028: Authentik correctly added to identityProviders oneOf unionIncluding the
authentikvariant in theidentityProviders.items.oneOfblock with the same shape as its definition ensures configs validate properly. This stays aligned with the other providers. LGTM.packages/schemas/src/v3/index.type.ts (2)
36-37: IdentityProviderConfig union correctly extendedAdding
AuthentikIdentityProviderConfigtoIdentityProviderConfigcleanly exposes the new provider type to consumers, consistent with how GCPIAP and others are wired. LGTM.
1405-1447: AuthentikIdentityProviderConfig interface is consistent with schema and source typesThe new
AuthentikIdentityProviderConfiginterface (provider/purpose plus env/Google Cloud Secret unions forclientId,clientSecret,issuer) matches both the JSON schema and the existing definition inidentityProvider.type.ts. LGTM.
Based on learnings frompackages/schemas/src/v3/identityProvider.type.tssnippet.docs/snippets/schemas/v3/identityProvider.schema.mdx (2)
651-759: AuthentikIdentityProviderConfig definition follows established pattern.The new definition correctly mirrors the structure of other multi-field OIDC providers (Okta, Keycloak) with required
issuerfield. Schema constraints are properly enforced viaadditionalProperties: false, and secret variants (env/googleCloudSecret) are correctly defined.Since this is an auto-generated file, please verify that the schema generation process produced these changes consistently across all related files mentioned in the summary (TypeScript types, index schema, etc.).
1406-1514: AuthentikIdentityProviderConfig oneOf variant correctly positioned and structured.The
oneOfentry properly duplicates the definition (standard schema pattern) and is positioned after the gcp-iap variant. The schema structure is consistent with other provider configurations.
Adds support for Authentik as a EE identity provider
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.