[PR #1103] [MERGED] feat: add oidc support #1389

Closed
opened 2026-02-26 19:33:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1103
Author: @tankerkiller125
Created: 4/14/2024
Status: Merged
Merged: 5/31/2024
Merged by: @Mythie

Base: mainHead: mk/oidc-auth


📝 Commits (5)

  • e0440fd feat: add oidc support
  • bd4a1c4 fix: update .env.example
  • 788c626 fix: signup page oidc function
  • d8d0734 Merge branch 'main' into mk/oidc-auth
  • 70eeb1a chore: improve oidc provider support

📊 Changes

14 files changed (+179 additions, -9 deletions)

View changed files

📝 .env.example (+4 -0)
📝 apps/web/process-env.d.ts (+4 -0)
📝 apps/web/src/app/(unauthenticated)/signin/page.tsx (+6 -3)
📝 apps/web/src/app/(unauthenticated)/signup/page.tsx (+2 -1)
📝 apps/web/src/components/forms/signin.tsx (+36 -2)
📝 apps/web/src/components/forms/signup.tsx (+42 -1)
📝 apps/web/src/components/forms/v2/signup.tsx (+38 -2)
📝 packages/lib/constants/auth.ts (+7 -0)
📝 packages/lib/next-auth/auth-options.ts (+24 -0)
packages/prisma/migrations/20240413202001_add_oidc_auth/migration.sql (+1 -0)
packages/prisma/migrations/20240530120101_add_missing_fields_to_account_model_for_oidc/migration.sql (+3 -0)
📝 packages/prisma/schema.prisma (+5 -0)
📝 packages/tsconfig/process-env.d.ts (+4 -0)
📝 turbo.json (+3 -0)

📄 Description


name: Pull Request
about: Submit changes to the project for review and inclusion

Description

This PR adds generic OIDC as an authentication provider. This allows personal users and companies potentially to define whatever IdP they want as long as it supports the OIDC well known format. (Azure, Zitadel, Authentik, KeyCloak, Google, etc. all support it)

Fixes #1090

Changes Made

  • Adds OIDC buttons to the signin and registration pages
  • Adds appropriate environment variables
  • Adds migration to add OIDC to the IdentityProvider Enum

Testing Performed

Zitadel

  • Created application in Zitadel as an web app, with Client auth
  • Enabled User Info inside ID Token in Token settings
  • Copied client id and client secret to the new .ENV variables
  • Copied the well-known URL from the URLs section to .ENV
  • Created new account with OIDC provider button
  • Verified email manually
  • Signed into account with OIDC provider
  • Logged out
  • Signed into accounting again with OIDC provider

Authentik

  • Created application in Authentik
  • Copied client id and client secret to the new .ENV variables
  • Copied the well-known URL from the URLs section to .ENV
  • Created new account with OIDC provider button
  • Verified email manually
  • Signed into account with OIDC provider
  • Logged out
  • Signed into accounting again with OIDC provider

Azure AD

  • Created application in Azure AD using OAuth2
  • Copied client id and client secret to the new .ENV variables
  • Copied the well-known URL from the URLs section to .ENV
  • Created new account with OIDC provider button
  • Verified email manually
  • Signed into account with OIDC provider
  • Logged out
  • Signed into accounting again with OIDC provider

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes

Summary by CodeRabbit

  • New Features
    • Introduced OIDC Single Sign-On (SSO) capabilities for both sign-in and sign-up processes, enhancing authentication options alongside existing Google SSO.
  • Enhancements
    • Updated sign-in and sign-up forms to support OIDC SSO, including new OIDC sign-in/sign-up buttons.
  • Documentation
    • Added necessary environment variables for OIDC configuration to the example file for clarity and setup guidance.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1103 **Author:** [@tankerkiller125](https://github.com/tankerkiller125) **Created:** 4/14/2024 **Status:** ✅ Merged **Merged:** 5/31/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `mk/oidc-auth` --- ### 📝 Commits (5) - [`e0440fd`](https://github.com/documenso/documenso/commit/e0440fd8a2133b9e4591fd3ac40b73b98fb3a9c2) feat: add oidc support - [`bd4a1c4`](https://github.com/documenso/documenso/commit/bd4a1c4c098d3130c3cc0a7642083ba06bd73d05) fix: update .env.example - [`788c626`](https://github.com/documenso/documenso/commit/788c6269a28398d698a64dd82a69c05ac3db34ee) fix: signup page oidc function - [`d8d0734`](https://github.com/documenso/documenso/commit/d8d0734680264f13f1104b99e64d26ee6a3adb05) Merge branch 'main' into mk/oidc-auth - [`70eeb1a`](https://github.com/documenso/documenso/commit/70eeb1a7468c60807a655c4ed2203827ecbd0048) chore: improve oidc provider support ### 📊 Changes **14 files changed** (+179 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+4 -0) 📝 `apps/web/process-env.d.ts` (+4 -0) 📝 `apps/web/src/app/(unauthenticated)/signin/page.tsx` (+6 -3) 📝 `apps/web/src/app/(unauthenticated)/signup/page.tsx` (+2 -1) 📝 `apps/web/src/components/forms/signin.tsx` (+36 -2) 📝 `apps/web/src/components/forms/signup.tsx` (+42 -1) 📝 `apps/web/src/components/forms/v2/signup.tsx` (+38 -2) 📝 `packages/lib/constants/auth.ts` (+7 -0) 📝 `packages/lib/next-auth/auth-options.ts` (+24 -0) ➕ `packages/prisma/migrations/20240413202001_add_oidc_auth/migration.sql` (+1 -0) ➕ `packages/prisma/migrations/20240530120101_add_missing_fields_to_account_model_for_oidc/migration.sql` (+3 -0) 📝 `packages/prisma/schema.prisma` (+5 -0) 📝 `packages/tsconfig/process-env.d.ts` (+4 -0) 📝 `turbo.json` (+3 -0) </details> ### 📄 Description --- name: Pull Request about: Submit changes to the project for review and inclusion --- ## Description <!--- Describe the changes introduced by this pull request. --> <!--- Explain what problem it solves or what feature/fix it adds. --> This PR adds generic OIDC as an authentication provider. This allows personal users and companies potentially to define whatever IdP they want as long as it supports the OIDC well known format. (Azure, Zitadel, Authentik, KeyCloak, Google, etc. all support it) ## Related Issue <!--- If this pull request is related to a specific issue, reference it here using #issue_number. --> <!--- For example, "Fixes #123" or "Addresses #456". --> Fixes #1090 ## Changes Made <!--- Provide a summary of the changes made in this pull request. --> <!--- Include any relevant technical details or architecture changes. --> - Adds OIDC buttons to the signin and registration pages - Adds appropriate environment variables - Adds migration to add OIDC to the `IdentityProvider` Enum ## Testing Performed <!--- Describe the testing that you have performed to validate these changes. --> <!--- Include information about test cases, testing environments, and results. --> #### Zitadel - Created application in Zitadel as an web app, with Client auth - Enabled `User Info inside ID Token` in Token settings - Copied client id and client secret to the new .ENV variables - Copied the well-known URL from the URLs section to .ENV - Created new account with OIDC provider button - Verified email manually - Signed into account with OIDC provider - Logged out - Signed into accounting again with OIDC provider #### Authentik - Created application in Authentik - Copied client id and client secret to the new .ENV variables - Copied the well-known URL from the URLs section to .ENV - Created new account with OIDC provider button - Verified email manually - Signed into account with OIDC provider - Logged out - Signed into accounting again with OIDC provider #### Azure AD - Created application in Azure AD using OAuth2 - Copied client id and client secret to the new .ENV variables - Copied the well-known URL from the URLs section to .ENV - Created new account with OIDC provider button - Verified email manually - Signed into account with OIDC provider - Logged out - Signed into accounting again with OIDC provider ## Checklist <!--- Please check the boxes that apply to this pull request. --> <!--- You can add or remove items as needed. --> - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [x] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes <!--- Provide any additional context or notes for the reviewers. --> <!--- This might include details about design decisions, potential concerns, or anything else relevant. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced OIDC Single Sign-On (SSO) capabilities for both sign-in and sign-up processes, enhancing authentication options alongside existing Google SSO. - **Enhancements** - Updated sign-in and sign-up forms to support OIDC SSO, including new OIDC sign-in/sign-up buttons. - **Documentation** - Added necessary environment variables for OIDC configuration to the example file for clarity and setup guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1389
No description provided.