Skip to content

Single Sign-On (OIDC, LDAP & Headers)

FynnCloud supports three enterprise Single Sign-On mechanisms that can be configured live in Administration → Settings → SSO (including encrypted .secret storage in PostgreSQL via SecretBox) or locked declaratively via environment variables (and <KEY>_FILE):

  1. OpenID Connect (OIDC) — Authorization Code flow with PKCE for Keycloak, Authentik, Microsoft Entra ID, Okta, Authelia, Zitadel, and Google Workspace.
  2. LDAP / Active Directory — Direct directory bind with optional StartTLS, strict TLS certificate validation, and periodic user/group catalog sync.
  3. Trusted Reverse-Proxy Headers — Forward-auth integration (Authelia, Authentik Proxy, Pomerium, Cloudflare Access) protected by a shared proxy secret.

Register the following redirect URI(s) in your OIDC client (Keycloak, Authentik, Entra ID, etc.):

https://<your-fynncloud-domain>/api/auth/sso/oidc/<providerKey>/callback

With the default ssoOidcProviderKey: "main":

https://cloud.example.com/api/auth/sso/oidc/main/callback

Native macOS/iOS clients (FynnCloud-Apple, FynnCloudTalk-Apple) complete browser OIDC against FynnCloud Server and then hand off to their own OAuth PKCE redirect (fynncloud://auth, fynncloud-talk://auth), so your IdP only needs FynnCloud Server’s callback URL above.

Setting Key Env Variable Default Description
ssoOidcEnabled SSO_OIDC_ENABLED false Enable OIDC sign-in button on the login screen
ssoOidcProviderKey SSO_OIDC_PROVIDER_KEY "main" URL slug in /api/auth/sso/oidc/<key>/callback
ssoOidcDisplayName SSO_OIDC_DISPLAY_NAME "Single Sign-On" Button label on login page
ssoOidcIssuerUrl SSO_OIDC_ISSUER_URL "" Base issuer URL serving /.well-known/openid-configuration
ssoOidcClientId SSO_OIDC_CLIENT_ID "" OAuth client ID
ssoOidcClientSecret SSO_OIDC_CLIENT_SECRET "" (secret) OAuth client secret (encrypted in DB or via env/_FILE)
ssoOidcScopes SSO_OIDC_SCOPES "openid email profile" Space-separated OIDC scopes
ssoOidcGroupsClaim SSO_OIDC_GROUPS_CLAIM "groups" ID token / UserInfo claim array containing group names

FynnCloud’s LDAP client enforces strict TLS certificate verification (LDAP_OPT_X_TLS_DEMAND), TLS 1.2+, referrals disabled, a 10-second request timeout, and a 5,000-entry search ceiling per query.

Setting Key Env Variable Default Description
ssoLdapEnabled SSO_LDAP_ENABLED false Enable LDAP authentication
ssoLdapHost SSO_LDAP_HOST "localhost" Directory server hostname (must match TLS cert CN/SAN)
ssoLdapPort SSO_LDAP_PORT nil (auto) Auto-selects 636 when ssoLdapUseSsl=true, 389 when false
ssoLdapUseSsl SSO_LDAP_USE_SSL true Connect over LDAPS (ldaps://). Set false + boot env LDAP_STARTTLS=true to use StartTLS on port 389
ssoLdapBaseDn SSO_LDAP_BASE_DN "" Base DN for user searches (e.g. ou=users,dc=example,dc=com)
ssoLdapBindDn SSO_LDAP_BIND_DN "" Service account DN used to search users/groups
ssoLdapBindPassword SSO_LDAP_BIND_PASSWORD "" (secret) Service account bind password
ssoLdapUserFilter SSO_LDAP_USER_FILTER "(uid={username})" Search filter ((sAMAccountName={username}) for Active Directory)
ssoLdapGroupBaseDn SSO_LDAP_GROUP_BASE_DN "" Optional base DN for group searches (falls back to ssoLdapBaseDn)
ssoLdapGroupFilter SSO_LDAP_GROUP_FILTER "" Optional custom LDAP group filter
ssoLdapTrustEmail SSO_LDAP_TRUST_EMAIL false Allow matching an existing non-admin local account by LDAP mail attribute
ssoLdapUuidAttribute SSO_LDAP_UUID_ATTRIBUTE "auto" Immutable subject identifier attribute (see below)

When ssoLdapUuidAttribute is "auto" (default), FynnCloud probes the user entry in order:

objectguid → entryuuid → ipauniqueid → nsuniqueid → guid

If none of those attributes exist on the LDAP entry, authentication is rejected with 401 Unauthorized rather than silently falling back to a mutable DN. Only if you explicitly configure SSO_LDAP_UUID_ATTRIBUTE=dn will FynnCloud accept the entry’s Distinguished Name as the subject ID.

When ssoUserSync or ssoGroupImport is enabled alongside LDAP, LDAPDirectorySyncJob runs automatically every 15 minutes (and can be triggered on demand via POST /api/sso/sync-groups and POST /api/sso/sync-users or from the Admin UI).


Authenticate users via headers injected by an authenticating reverse proxy (such as Authelia, Authentik ForwardAuth, or Pomerium):

Setting Key Env Variable Default Description
ssoHeaderEnabled SSO_HEADER_ENABLED false Enable Trusted Header authentication
ssoHeaderEmail SSO_HEADER_EMAIL "" Header carrying user email (e.g. Remote-Email)
ssoHeaderName SSO_HEADER_NAME "" Header carrying display name (e.g. Remote-Name)
ssoHeaderGroups SSO_HEADER_GROUPS "" Header carrying comma-separated groups (e.g. Remote-Groups)
ssoHeaderRole SSO_HEADER_ROLE "" Optional header mapped to trusted_header_role
ssoHeaderSecret SSO_HEADER_SECRET "" (secret) Shared secret header validated on every request to prevent header spoofing

Provisioning, Account Linking & Group Reconciliation

Section titled “Provisioning, Account Linking & Group Reconciliation”
Setting Key Env Variable Default Behavior
ssoAutoProvision SSO_AUTO_PROVISION true Automatically create a new FynnCloud user on first SSO sign-in (subject to instance user limit). Set false to allow only pre-existing accounts.
ssoUserSync SSO_USER_SYNC false Enable periodic LDAP user catalog synchronization
ssoGroupImport SSO_GROUP_IMPORT false Automatically create local FynnCloud groups for incoming IdP groups
ssoGroupAutoMatch SSO_GROUP_AUTO_MATCH false Automatically match incoming external group names to existing local FynnCloud groups
ssoGroupPrefix SSO_GROUP_PREFIX "" Prefix prepended to local FynnCloud group names created or reconciled by ssoGroupImport and LDAP group catalog sync (localName = groupPrefix + externalName, e.g. LDAP: imports engineering as LDAP: engineering). Does not filter external groups.
ssoGroupMap SSO_GROUP_MAP "" Explicit mapping rules using external->localKey syntax, separated by ; or newlines (e.g. cn-admins->administrators;engineering->dev-team)

Understanding these guarantees prevents surprises during enterprise rollouts:

  1. Username and email are NEVER overwritten on IdP rename: On subsequent logins, SSOService.syncProfile updates only displayName from the identity provider. It intentionally preserves the user’s FynnCloud username and email so WebDAV URLs, share references, and audit logs remain stable even if someone changes names or email aliases in your directory.
  2. Administrator email auto-linking is strictly refused (403): Even when ssoLdapTrustEmail=true or OIDC returns a verified email matching an existing local administrator account, FynnCloud refuses to auto-link a local admin account by email to prevent privilege-escalation attacks via IdP account creation. Link admin identities explicitly or assign admin privileges via mapped SSO groups.
  3. ssoGroupAutoMatch filtering rules: Auto-matching compares incoming group names only against existing non-admin, non-system local groups (isAdmin == false and systemKey == nil). It never auto-grants the Administrators group by name collision (use explicit ssoGroupMap if you intentionally want to map an external group to administrators), and it does match custom storage-tier groups so quota tiers work seamlessly with SSO groups.
  4. Per-provider group reconciliation: Each SSO link tracks which group memberships it manages, so removing a user from a group in Keycloak/LDAP removes them from that mapped group in FynnCloud on next login without wiping manually assigned local groups.