Connect single sign-on.
Last updated
What you are building
Sign-in through your existing identity provider, so AccessFlow stops being another password to manage and offboarding somebody in one place actually removes their access. There are three pieces, and you do not need all of them:
- OAuth 2.0 / OIDC — the simplest path, with ready-made templates for Google, GitHub, Microsoft and GitLab, and a generic option for anything else.
- SAML 2.0 — for enterprise identity providers that expect it.
- SCIM 2.0 — provisioning, so accounts are created and deactivated by the identity provider rather than by hand.
Should I use OAuth, SAML or SCIM for AccessFlow single sign-on?
If your provider speaks both, prefer OAuth 2.0 / OIDC — the setup is one redirect URL and a client secret. Reach for SAML when that is what your identity team supports. Add SCIM on top of either once you care about accounts disappearing automatically when somebody leaves.
1. OAuth 2.0 / OIDC
Admin section → OAuth providers. Each provider is a tab: Google, GitHub, Microsoft, GitLab, GitHub Enterprise, GitLab (self-managed), and OpenID Connect for everything else — Keycloak, Auth0, Okta, Authentik, Zitadel and the rest.
- Copy the redirect URI first. The page shows it read-only with a copy button, labelled Redirect URI to register with the provider. Paste that exact string into your provider's console — AccessFlow accepts the callback at that path and no other.
- Create the application in your identity provider and collect its client id and secret.
- Fill in AccessFlow. Client ID and Client secret, then set Default role for new users, and switch Active on.
Two provider-specific fields appear where they apply. Microsoft asks for a
Tenant ID — common for any Microsoft account,
organizations for any work or school account, or a specific tenant. The two
self-hosted templates require a Server base URL: the origin of your
instance, with no path and no query string.
Restrict who can get in. Allowed email domains accepts
a list matched case-insensitively against the email domain; empty means any domain is
accepted, which on a public provider like Google means anyone with an account. On GitHub
and GitLab, Allowed organizations restricts sign-in to members of named
organizations — on GitHub that needs the read:org scope, and the page warns
you when you set a list without it.
The client secret is encrypted at rest and never returned; the form shows a mask, and leaving it untouched keeps the stored value.
2. SAML 2.0
Admin section → SAML / SSO. The form has three parts: what your identity provider is, what AccessFlow calls itself, and how attributes map onto users.
Under Service provider, set ACS URL explicitly to your
backend origin followed by /api/v1/auth/saml/acs/default. That is the path
AccessFlow actually processes assertions on, and the same URL you register with your
identity provider as the assertion consumer service.
Most identity providers would rather import metadata than have you type fields. Point
yours at your backend origin followed by
/api/v1/auth/saml/metadata/default.
Under Attribute mapping, Email attribute and
Display-name attribute are required and default to email
and displayName. Role attribute is optional: set it and
AccessFlow reads the user's role from that assertion attribute, falling back to the
default role when it is missing or unrecognised.
The signing certificate you paste is encrypted at rest and masked on read. AccessFlow
signs its own requests with a keypair it generates and stores on first use, unless you
pin one with ACCESSFLOW_SAML_SP_SIGNING_KEY_PEM and
ACCESSFLOW_SAML_SP_SIGNING_CERT_PEM. Configuration changes take effect
immediately — there is no restart, and no metadata refresh cycle to wait for.
3. SCIM provisioning
Admin section → SCIM Provisioning. This is the piece that makes offboarding real: your identity provider creates, updates and deactivates AccessFlow accounts as people join and leave.
- Switch it on and copy the Base URL the page shows
— your backend origin followed by
/scim/v2. That is what your identity provider asks for. - Create a token. Under Bearer tokens, choose
Create token and name it after the system that will use it. The raw
af_scim_…value is shown once and never again — paste it into your provider immediately. Only a hash is stored, and the list shows a short prefix so you can tell tokens apart. - Map the attributes. Choose which SCIM attribute carries the email and which carries the display name, and set the role provisioned users get.
Tokens are scoped to your organization, and revoking one cuts that identity provider off immediately.
If sign-in does not work
- The provider rejects the redirect. The registered URL does not match the one AccessFlow expects, character for character. Re-copy it from the OAuth providers page rather than retyping.
- Sign-in succeeds, then the app rejects it. Read the error code on the callback screen. It distinguishes a missing email claim, an unverified email, a domain or organization that is not on the allow-list, an address that already exists as a local account, and a disabled account.
- SAML appears configured but nothing happens. Almost always one of the two required identity-provider fields is blank. Fill in both.
- Browser errors about origins. Check
CORS_ALLOWED_ORIGIN: AccessFlow allows exactly one frontend origin, and the post-sign-in redirect targets are derived from it.
Provider-by-provider walkthroughs, the full field reference and the error-code list: Auth & SSO.