n8n SSO Setup Guide: SAML, OIDC, LDAP
Complete guide to setting up SSO in n8n: SAML, OIDC, LDAP configuration for Business and Enterprise plans. Includes Okta, Azure AD, Keycloak setup and troubleshooting.
- n8n supports SAML, OIDC, and LDAP SSO starting at the Business plan for self-hosted, Enterprise for Cloud
- SAML is traditional, OIDC is modern and simpler, LDAP is for Active Directory but does not support Kerberos
- Community edition has no native SSO; use a reverse proxy (OAuth2 Proxy) or upgrade to Business/Enterprise
- Redirect URL mismatches are the most common setup error; ensure URLs in n8n and your identity provider match exactly
- LDAP users are created on first login but not synced; deletions do not propagate automatically to n8n
Single sign-on is essential if you want to centralize user identity across your team. n8n supports SAML, OIDC, and LDAP for enterprise deployments, though Community edition users will need an alternative approach. This guide walks you through each method, which plan supports what, and how to get users logged in without storing passwords.
Why SSO Matters for n8n (and Which Plans Support It)
SSO solves the password problem: users log in once to your company identity provider, and n8n grants access automatically. No separate password to remember. No credential sprawl. When someone leaves, disabling them in your identity provider revokes n8n access instantly. It is mandatory if you work in regulated industries or manage teams larger than a handful.
n8n's SSO availability is locked by edition. Cloud deployments get enterprise authentication only on the Enterprise plan. Self-hosted installations support SSO starting at the Business plan. Community edition does not include native SSO, though a reverse proxy can bridge the gap. If your team is large enough to need SSO, you are likely already on Business or Enterprise anyway.
SAML is the oldest standard. OIDC is newer and cloud-native. LDAP is for Active Directory integration. Each has tradeoffs: SAML requires XML configuration and an identity provider that speaks SAML (Okta, Azure AD, Keycloak). OIDC is simpler for cloud-first teams but requires OIDC-capable providers. LDAP is the choice if your company runs Active Directory or OpenLDAP on-premise. We cover all three below, plus workarounds for teams locked out of native SSO.
Read our comparison of n8n Community vs. Enterprise editions to confirm which plan fits your team's authentication needs.
SAML SSO: Setup and Use Cases
Use SAML if your identity provider predates the cloud era or if you manage a traditional corporate directory. Okta, Ping Identity, Azure AD, and JumpCloud all speak SAML. SAML requires Business or Enterprise plans on self-hosted; Enterprise only on Cloud. The setup flow: register n8n as a SAML service provider in your identity provider, download the provider's metadata file, upload it to n8n's admin panel, and test user login.
SAML authentication involves an XML handshake. Your identity provider hosts a metadata endpoint describing how to authenticate users and where to send them after login. You import this metadata into n8n's SSO configuration, then export n8n's own metadata to upload back to your provider. The metadata includes n8n's login callback URL (the endpoint where users land after authentication). This URL must be publicly accessible and match your load balancer's external hostname.
Common SAML gotchas: redirect URL mismatch is the top culprit. If your metadata specifies the ACS endpoint on one domain but your identity provider redirects to a different hostname or port, login fails silently. Double-check the URLs in both systems match exactly. Certificate errors are second: if your n8n instance uses a self-signed TLS certificate, some identity providers reject it. Use a valid certificate from a trusted CA.
SAML also supports automatic user provisioning via Just-In-Time (JIT) provisioning. When a user logs in, n8n can auto-create an account if one does not exist. You control this in n8n's SSO settings: enable "Auto Create Users" to allow it, or disable it to require manual user registration before SAML login works. The latter is safer if you want to gate access.
OIDC SSO: Setup and Use Cases
OIDC is simpler than SAML for cloud-native teams. If you use Okta, Auth0, Google Workspace, or any modern OAuth provider, OIDC is the path of least resistance. It requires Enterprise plan on both Cloud and self-hosted. OIDC setup: register n8n as an "application" or "client" in your provider, copy the client ID and client secret into n8n's admin panel, and test.
OIDC flows work like OAuth: n8n redirects the user to your identity provider's login page, the user authenticates, and the provider sends a token back to n8n proving who the user is. n8n then creates or updates the user record and logs them in. This token-based approach is stateless: n8n does not hold the password, only the token. If the token expires, the user is logged out and must re-authenticate.
OIDC adds flexibility: you can request custom scopes (additional claims from the identity provider) and validate the user's email domain before creating an account. For example, you can require that users have an email ending in @company.com, automatically rejecting external accounts. This is configured via n8n's OIDC settings and your provider's scope configuration.
One key difference from SAML: OIDC is push-pull rather than pull-only. SAML requires your identity provider to know about n8n upfront. OIDC lets n8n reach out to any OIDC-capable provider. This is why OIDC is easier for SaaS adoption: you can point n8n at your provider without asking your provider's admin to register you first (though registration is required for security).
LDAP Directory Login: Setup and Limitations
LDAP is the choice if your company runs Microsoft Active Directory or OpenLDAP on-premise. LDAP available starting at Business plan on self-hosted; Enterprise only on Cloud. LDAP setup requires knowing your directory's hostname, port, bind credentials, and the LDAP query filter that identifies users. n8n connects to your LDAP server, searches for a user by username or email, and validates the password against the directory.
LDAP binding: your n8n instance can bind to LDAP in two ways. Anonymous binding (no credentials required) allows anyone to query the directory but not validate passwords. Authenticated binding (using a service account) is more common: n8n uses a read-only service account to search the directory, then validates the user's password. The service account must have read access to user objects and their password hashes. If you use a managed directory like Azure AD, you must use authenticated binding.
Attribute mapping: LDAP directories store user data (name, email, groups) as attributes on user objects. n8n lets you configure which attributes populate which user fields in n8n. For example, you might map the LDAP attribute mail to n8n's email field. You can also map LDAP groups to n8n user roles, though this is more advanced. The docs recommend starting with a simple email-to-email mapping, then adding complexity if needed.
LDAP sync and limitations: n8n does not sync LDAP users on a schedule. Users are created on first login. If a user's LDAP entry is deleted, the n8n user account persists (n8n does not delete accounts automatically). To clean up stale accounts, you must delete them manually in n8n's admin panel or via API. This is a critical difference from SAML or OIDC: deletions do not propagate automatically.
One critical limitation: LDAP does not support Kerberos, SASL, or GSSAPI (the Windows integrated authentication protocols). If your company uses Kerberos or GSSAPI for Active Directory, you cannot use LDAP directly. Use SAML or OIDC with an identity provider that speaks Kerberos (like Okta or Azure AD) as a bridge instead. This is a common pain point for Windows-heavy organizations.
Common Identity Providers (Okta, Azure AD, Keycloak, OpenLDAP)
Okta is the market leader for SAML and OIDC. It supports both protocols, integrates with almost any directory (Active Directory, Okta Directory, LDAP backends), and handles provisioning well. n8n's docs include a Okta-specific SAML setup guide. If you use Okta, follow the official guide; if you get stuck, check the n8n community forum where several users have posted Okta+JumpCloud and other Okta-specific setups.
Azure AD (now Entra ID) is Microsoft's cloud identity service. If your company licenses Office 365 or uses Windows Server Active Directory, Azure AD is usually already set up. Azure AD speaks SAML and OIDC. n8n's docs include an Azure AD SAML setup guide. The integration is tight: Azure AD can sync on-premise AD to the cloud, so you get unified authentication across your company.
Keycloak is an open-source identity provider. It is self-hosted, so you run it on your own infrastructure. Keycloak supports SAML, OIDC, and LDAP as backends (you can configure Keycloak to proxy to your on-premise Active Directory). Keycloak is excellent if you want SSO but cannot use a commercial service. Setup is more involved: you deploy Keycloak (usually Docker), configure it to point to your directory, then register n8n as an application in Keycloak.
OpenLDAP is an open-source LDAP server. It is not an identity provider per se; it is a directory server. You would use OpenLDAP with LDAP login in n8n, not SAML or OIDC. If you have OpenLDAP running, n8n's LDAP setup guide applies directly. Configuration is similar to Active Directory, but you must know your LDAP schema and DN structure (which OpenLDAP admins know well, but can be opaque to newcomers).
SSO for Self-Hosted n8n: Infrastructure and Environment Variables
Self-hosted SSO requires a public, stable URL for your n8n instance. If you are running n8n behind a load balancer or reverse proxy, you must configure the external URL so n8n knows its public hostname. Identity providers validate the redirect URL carefully: if n8n thinks its URL is localhost or an internal IP but your IdP redirects to your public domain, the URLs do not match and login fails.
Set the external URL via the N8N_EDITOR_BASE_URL environment variable to your public hostname. n8n uses this URL in SAML/OIDC metadata and redirect links. Without it, the URLs are guessed from request headers, which is fragile if you use a proxy.
SSO environment variables are available in n8n 2.18.0 and later. If you run an older version, upgrade to access SSO configuration via environment variables (instead of only the admin UI). This is essential for infrastructure-as-code and containerized deployments.
TLS is required. Your identity provider will reject non-HTTPS URLs for security (they do not want SSO tokens flying over cleartext connections). If you run n8n self-hosted, obtain a valid TLS certificate from Let's Encrypt or your certificate authority. Self-signed certs are OK for development, but IdPs reject them in production.
Load balancer setup: if you run n8n behind a load balancer that terminates TLS, make sure the load balancer passes the original URL to n8n via the X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-Port headers. n8n checks these headers to reconstruct the external URL. Most load balancers (nginx, HAProxy, cloud LBs) do this automatically; check your config if URLs are wrong.
Alternatives: SSO for n8n Community Edition (Reverse Proxy Pattern)
Community edition does not include SSO. If you are locked into Community for cost reasons, you can add authentication via a reverse proxy. The pattern: place OAuth2 Proxy or a similar tool in front of n8n, configure it to authenticate users against your identity provider, and proxy authenticated requests to n8n. n8n sees the authenticated user (via a header injected by the proxy) and treats them as logged in.
OAuth2 Proxy is a lightweight reverse proxy that handles OIDC, SAML, and other OAuth flows. You run it as a separate process, configure it to point to your identity provider, and route n8n traffic through it. When an unauthenticated user arrives, OAuth2 Proxy redirects them to your IdP. After login, OAuth2 Proxy adds an authorization header and proxies the request to n8n.
This pattern has tradeoffs. Pro: works with Community edition, no code changes to n8n. Con: you manage two services now instead of one, debug authentication in the proxy layer rather than in n8n, and you lose n8n's native user role management (the proxy cannot distinguish n8n user roles, it only knows "authenticated" or "not"). User provisioning is also manual: when you add a user to your identity provider, the proxy allows them in, but n8n does not auto-create a user account; they get a generic default account instead.
Another alternative: upgrade to Business or Enterprise. The SSO feature is worth the cost if you have a team and need secure, manageable authentication. For a 10-person team, the cost per user drops quickly, and native SSO is simpler to operate than a proxy layer.
Opsily offers managed n8n hosting in Europe with Business and Enterprise plans pre-configured. If you want SSO without managing infrastructure, this is a convenient option.
Troubleshooting Common SSO Issues
Redirect URL mismatches are the most common issue. If your configured redirect endpoint differs from where your identity provider actually redirects (different domain, port, or path), login fails silently. Check the redirect URL in both n8n and your identity provider. They must match character-for-character.
Certificate/TLS errors: if your n8n instance uses a self-signed certificate and your identity provider is in the cloud, the IdP may reject the certificate as untrusted. Use a certificate signed by a trusted CA (Let's Encrypt is free). For development, some IdPs allow certificate pinning or disabling verification; check your IdP's configuration.
User provisioning gotchas: if "Auto Create Users" is enabled in n8n, users are created on first login. If disabled, users must already exist in n8n before SAML/OIDC login works. If a user logs in but gets a "user not found" error, check this setting. If you want to gate access, disable auto-create and manually add users first.
Attribute mismatch (LDAP): if users cannot log in via LDAP, the bind or search query is wrong. Test your LDAP query with an LDAP client tool (ldapsearch) before configuring n8n. Confirm the bind credentials are correct and the search filter matches your user objects.
Timeout errors: if authentication hangs or times out, your n8n instance may not reach your identity provider. Check firewall rules, network routing, and DNS resolution. If you use a self-hosted IdP behind a firewall, ensure n8n has network access.
For additional help, check the n8n community forum; multiple users have posted setups for Okta, JumpCloud, Keycloak, and Azure AD. The n8n GitHub repository also hosts issues and discussions on SSO configuration.
Frequently Asked Questions
Which authentication method should I choose: SAML, OIDC, or LDAP?
Choose based on your identity provider and infrastructure. SAML is traditional and works with most enterprise IdPs. OIDC is simpler for cloud-first teams and modern providers like Auth0. LDAP is for on-premise Active Directory or OpenLDAP. If your company uses Okta or Azure AD, all three work, so check your IdP's docs for which is recommended (usually SAML or OIDC).
How do I set up SAML SSO in n8n?
Register n8n as a SAML service provider in your identity provider. Download the provider's metadata file. In n8n's admin settings, enable SAML SSO and upload the metadata file. Export n8n's metadata and upload it back to your identity provider. Test by logging out and trying to log in via your IdP. If login fails, check redirect URLs for mismatches.
What is the difference between SAML and OIDC?
SAML uses XML assertions and is older; OIDC uses JSON tokens and is newer. Both authenticate users, but OIDC is stateless and cloud-friendly, while SAML is more rigid. OIDC is easier to set up with modern providers. If your IdP supports both, OIDC is usually simpler.
How do I configure LDAP login in n8n?
Provide your LDAP server's hostname, port, bind credentials (service account), and the search filter that identifies users (e.g., uid={0}). n8n tests the connection and searches for a user by username. The user's password is validated against the LDAP server. Map LDAP attributes to n8n user fields (e.g., email to email).
Why is SSO not available in n8n Community edition?
SSO is a Business and Enterprise feature. Community edition is free and open-source, so commercial features like SSO are excluded. If you need SSO, upgrade to Business or use a reverse proxy workaround.
Can I use SSO with n8n self-hosted?
Yes. Self-hosted n8n on Business or Enterprise plans supports SSO. Set the N8N_EDITOR_BASE_URL environment variable to your public URL, configure SSO via admin settings or environment variables, and ensure TLS is enabled. Cloud deployments only support SSO on Enterprise.
How do I enable automatic user provisioning via SAML?
In n8n's SAML settings, enable "Auto Create Users" or "Allow user creation from identity provider". When a user logs in via SAML and no n8n account exists, n8n creates one automatically using data from the SAML assertion (name, email). Disable this if you want to control account creation manually.
What are the limitations of LDAP in n8n?
LDAP does not support Kerberos or GSSAPI (Windows integrated auth). LDAP users are created on first login but not synced automatically; deletions do not propagate back. If a user is deleted from LDAP, the n8n account persists and must be deleted manually. Use SAML or OIDC if you need Kerberos.
The Bottom Line
SSO is not optional if you have a team and care about security. n8n's native SSO (SAML, OIDC, LDAP) is straightforward once you understand which protocol your identity provider speaks and configure the URLs correctly. SAML and LDAP require Business plan minimum; OIDC requires Enterprise. For Community edition, a reverse proxy is the workaround, though it adds operational overhead.
If you are evaluating n8n for your team, confirm your plan tier supports the authentication method you need. Start with Opsily's managed n8n hosting to skip the infrastructure setup entirely and focus on connecting your identity provider.