Enterprise Feature: OIDC SSO is part of our Enterprise Edition. During
the beta period: - Self-hosted: Free to use (no subscription required) -
Cloud: Available on Pro plan (will move to Enterprise plan soon) This
feature helps fund ongoing development and keeps OpnForm sustainable. For
more information about Enterprise licensing, see our Enterprise
Terms.
OpnForm handles OIDC redirect URLs automatically. You don’t need to manually
configure redirect URLs in your OIDC provider - the system generates them
dynamically and displays them in the connection settings.
Features
- Domain-Based Routing: Automatically routes users to the correct OIDC provider based on their email domain
- Group-to-Role Mapping: Automatically assign workspace roles based on IdP groups
- Custom Field Mappings: Support for custom claim field names from your IdP
- Automatic User Provisioning: Creates users automatically on first login
- Force Login Mode: Optionally require all users to authenticate via OIDC
Prerequisites
Before setting up OIDC SSO, ensure you have:- An OIDC-compliant identity provider (IdP) configured
- OAuth client credentials (Client ID and Client Secret) from your IdP
- Admin access to the workspace where you want to configure SSO
- The issuer URL from your IdP (typically found in the
.well-known/openid-configurationendpoint)
Setup Steps
1
Get OIDC Provider Information
From your identity provider, collect the following information:
- Issuer URL: The base URL of your IdP (e.g.,
https://idp.company.comorhttps://login.microsoftonline.com/{tenant-id}/v2.0) - Client ID: OAuth client identifier
- Client Secret: OAuth client secret
- Email Domain: The domain you want to use for routing (e.g.,
company.com)
2
Create OIDC Connection
- Navigate to your workspace settings
- Go to the SSO section
- Click Add Connection
-
Fill in the connection details:
- Name: Display name for this connection (e.g., “Company SSO”)
- Slug: Unique identifier used in URLs (e.g.,
company-sso) - Email Domain: Domain for routing users (e.g.,
company.com) - Issuer URL: Your IdP’s issuer URL
- Client ID: OAuth client ID from your IdP
- Client Secret: OAuth client secret from your IdP
The redirect URI will be displayed automatically. Copy this URL and add it to your IdP’s allowed redirect URIs.
3
Configure Redirect URI in IdP
- Copy the redirect URI shown in the connection form
- In your IdP’s application settings, add this redirect URI to the allowed redirect URIs list
- Save the configuration in your IdP
4
Configure Group-to-Role Mapping (Optional)
If your IdP provides group information in the ID token, you can map IdP groups to workspace roles:
- In the connection settings, expand Role Mappings
- Click Add Mapping
- Enter the IdP group name (as it appears in your ID token)
- Select the corresponding workspace role (owner, admin, editor, or member)
- Repeat for each group you want to map
If a user belongs to multiple groups, the highest privilege role will be assigned. Role priority: owner > admin > editor > member.
5
Configure Field Mappings (Optional)
If your IdP uses non-standard claim names for email or name:
- In the connection settings, expand Field Mappings
- Enter the custom claim field name for email (if different from
email) - Enter the custom claim field name for name (if different from
name) - Save the connection
If field mappings are not configured, OpnForm will use standard OIDC claim names (
email, name, etc.).6
Enable and Test
- Ensure the connection is Enabled
- Save the connection
- Test the login flow:
- Navigate to the login page
- Enter an email address matching your configured domain
- You should be redirected to your IdP for authentication
- After successful authentication, you’ll be redirected back and logged in
If everything is configured correctly, users with emails from your domain will automatically be routed to your IdP for authentication.
Force Login Mode
Force Login Mode requires all users to authenticate via OIDC, disabling password-based login.Configuration
Set theOIDC_FORCE_LOGIN environment variable to true in your backend .env file:
Behavior
When enabled:- Password-based login attempts are blocked
- Users attempting password login receive: “Password-based login is disabled. Please use OIDC authentication.”
- The login form automatically redirects users to their OIDC provider based on email domain
- If
force_loginis enabled but no OIDC connections exist, password login remains available as a fallback
Use Cases
- Organizations requiring all users to authenticate via corporate SSO
- Security policies mandating centralized identity management
- Compliance requirements for authentication methods
Supported Providers
OpnForm is compatible with any OIDC-compliant identity provider, including:- Azure Entra ID (formerly Azure AD)
- Authentik
- Okta
- Keycloak
- Google Workspace (via OIDC)
- Any other OIDC-compliant provider
Azure Entra ID Specific Notes
- May require additional scopes (e.g.,
groups) to include groups in the ID token - Configure group claims in Azure AD app registration → Token configuration
- Choose “Security groups” or “Directory roles” as needed
Authentik Specific Notes
- Groups are typically included automatically in ID tokens
- Standard OIDC configuration works out of the box
Troubleshooting
Users Not Being Redirected to IdP
Users Not Being Redirected to IdP
Possible causes:
- Email domain doesn’t match the configured domain
- Connection is disabled
- Domain not properly configured in connection settings
Redirect URI Mismatch Error
Redirect URI Mismatch Error
Possible causes:
- Redirect URI not added to IdP’s allowed list
- Redirect URI copied incorrectly
- HTTPS/HTTP mismatch
Groups Not Mapping to Roles
Groups Not Mapping to Roles
Possible causes:
- Groups not included in ID token
- Group names don’t match exactly
- Group claim not configured in IdP
User Creation Fails
User Creation Fails
Possible causes:
- Email claim missing from ID token
- Field mappings incorrect
- Account with same email already exists (account linking blocked for security)
Force Login Not Working
Force Login Not Working
Possible causes:
OIDC_FORCE_LOGINnot set totrue- No OIDC connections configured
- Environment variable not loaded (restart required)
Security Considerations
HTTPS Requirement
In production, all OIDC redirects require HTTPS. Ensure your application is served over HTTPS before configuring OIDC.Account Linking
For security, OpnForm prevents automatic linking of existing accounts. If a user with the same email already exists but isn’t linked to the OIDC connection, authentication will fail with a message to contact the administrator.SSO-Only Accounts
Users created via OIDC SSO are created with:- Random 64-character password (prevents password-based login)
- Email automatically verified
- Provider metadata stored for tracking
Best Practices
- Test First: Always test with a small group before rolling out to all users
- Monitor Logs: Check application logs for OIDC-related errors during initial setup
- Backup Access: Ensure at least one admin account can still access the system if OIDC fails
- Regular Updates: Keep your IdP configuration in sync with OpnForm connection settings
- Documentation: Document your IdP configuration for future reference
With properly configured OIDC SSO, your users can seamlessly authenticate
using their organization’s identity provider, improving security and user
experience.