Documents
SSO OIDC Authentication
SSO OIDC Authentication
Type
Document
Status
Published
Created
Mar 4, 2026
Updated
Mar 5, 2026
Updated by
Dosu Bot

SSO OIDC Authentication Documentation - Draft Outline#

Overview#

Key Features#

Database Schema#

Setup/Configuration#

Prerequisites#

Callback URL Format#

  • Pattern: {BASE_URL}/api/auth/sso/callback/{providerId}
  • Displayed in SSO settings UI for copying to OIDC provider config
  • Examples: http://localhost:4096/api/auth/sso/callback/test-oidc

Provider Registration#

Management#

  • SSO settings section shows:
    • Provider ID, domain, issuer, type
    • Callback URL (read-only)
    • Auto-link toggle per provider
    • Delete button
    • Invitation management interface

User Flow#

For Administrators#

  1. Register SSO Provider: Access Settings → Users → SSO tab
  2. Copy Callback URL: From SSO settings display
  3. Configure Identity Provider: Add callback URL to OIDC provider
  4. Create Invitations: Send invitations with email and role (member, admin, owner)
  5. Manage Settings: Toggle auto-linking, delete providers, cancel invitations

For Users#

  1. Receive Invitation: Email invitation sent by admin
  2. Navigate to Login: Login page displays SSO provider buttons
  3. Click SSO Button: Initiates OIDC flow
  4. Authenticate: Complete login at identity provider
  5. Automatic Processing:
  6. Access Granted: User redirected to application

Important

Account Linking Constraints: The canLinkSsoAccount() function enforces security rules to prevent cross-organization account conflicts:

  • New SSO users (without existing accounts) can link via valid pending invitations to join an organization
  • Existing credential users (with username/password accounts) cannot link via SSO, even with valid invitations

Invitation Management#

Security Considerations#

Warning

Only enable auto-linking for identity providers you fully trust. An attacker controlling the SSO provider could gain access to existing accounts if auto-linking is enabled.

Security Features#

Multi-Tenancy#

API Endpoints#

Troubleshooting#

403 Forbidden Error#

Cause: User doesn't have a valid pending invitation or has an existing credential account that blocks SSO linking

Solution:

  1. Verify invitation was created for the user's email
  2. Check invitation hasn't expired (7-day default)
  3. Ensure invitation status is "pending"
  4. Verify email addresses match exactly (case-insensitive)
  5. Confirm user doesn't have an existing credential account in the system (SSO linking is blocked for existing accounts)

Provider Registration Fails#

Possible causes:

Callback URL Mismatch#

Cause: Callback URL not configured in identity provider

Solution:

  1. Copy exact callback URL from SSO settings: {BASE_URL}/api/auth/sso/callback/{providerId}
  2. Add to identity provider's allowed redirect URIs
  3. Ensure BASE_URL matches your deployment URL

Auto-Linking Not Working#

Verification:

Error Message: "SSO sign-in was blocked because this email already belongs to another user in this instance. Contact your administrator to resolve the account conflict."

Cause: User has an existing credential account (username/password) in the system, which blocks SSO account linking even with valid invitations

Solution:

  • This is a security constraint to prevent cross-organization account conflicts
  • Existing credential users cannot link via SSO to different organizations
  • Contact administrator to resolve the account conflict or use credential login for the existing account