Single sign-on
Set up SAML 2.0 or OpenID Connect for Okta, Google Workspace or Microsoft Entra ID, verify an email domain and turn on Require SSO.
Short answer: Gitfence supports SAML 2.0 and OpenID Connect with Okta, Google Workspace and Microsoft Entra ID. SSO is Enterprise; you can require it.
Steps
- Copy your Gitfence details. Go to Settings → Single sign-on:
- SP Entity ID:
https://gitfence.dev/sso/<org-id>/saml/metadata - ACS URL:
https://gitfence.dev/sso/<org-id>/saml/acs - Metadata URL:
https://gitfence.dev/sso/<org-id>/saml/metadata - OIDC redirect URI:
https://gitfence.dev/sso/<org-id>/oidc/callback
- SP Entity ID:
- Configure the provider.
- Okta: Applications → Create App Integration → SAML 2.0, or OIDC - Web Application. For SAML, set Single sign-on URL to the ACS URL, Audience URI (SP Entity ID) to the SP Entity ID, Name ID format to
EmailAddressand Application username toEmail. For OIDC, set Sign-in redirect URI to the OIDC redirect URI. On Sign On, copy the Metadata URL, or note the issuer, client ID and secret. - Google Workspace: Admin console → Apps → Web and mobile apps → Add app → Add custom SAML app. Download the IdP metadata (Option 1). Set ACS URL and Entity ID, choose EMAIL and Basic Information > Primary email as the Name ID. Turn User access on and paste the metadata XML into Gitfence.
- Microsoft Entra ID: Entra admin center → Enterprise applications → New application → Create your own application (non-gallery), then Single sign-on → SAML. In Basic SAML Configuration, set Identifier (Entity ID) and Reply URL (ACS). Keep
user.userprincipalnameoruser.mailas the unique identifier. Copy App Federation Metadata Url into Gitfence.
- Okta: Applications → Create App Integration → SAML 2.0, or OIDC - Web Application. For SAML, set Single sign-on URL to the ACS URL, Audience URI (SP Entity ID) to the SP Entity ID, Name ID format to
- Save it. Under Identity provider, choose SAML 2.0 or OpenID Connect. For SAML, choose Metadata URL or Paste XML, then Save SAML settings. For OIDC, enter Issuer URL, Client ID and Client secret, then Save OIDC settings.
- Verify an email domain. Under Email domains, choose Add domain, then add its DNS TXT record:
_gitfence-challenge.<domain>withgitfence-domain-verification=<token>. Choose Verify. Only verified domains route Continue with SSO. - Test and enforce. Choose Test sign-in, then tick Require SSO.
First sign-in
Gitfence asks the person to connect GitHub: Continue with GitHub, then confirm Link
Require SSO and recovery
Require SSO needs an owner, a provider, a successful test, the owner's SSO sign-in and a verified domain. Git and MCP tokens keep working.
Turning it on returns eight recovery codes, shown once. Each works once for one hour, after the owner signs in with GitHub and uses Can't reach your identity provider? (owners). Create new recovery codes invalidates the old ones. An owner can always turn Require SSO off, including after a recovery code.
Gotchas
- Replacing the provider or removing SSO requires turning Require SSO off first.
Next: SCIM provisioning.
Related guides
- SCIM provisioningConnect Okta or Microsoft Entra ID over SCIM, map IdP groups to access groups and see how deprovisioning and GitHub renames behave.
- Offboarding and exit packsEnd a person's access, revoke tokens and agents, and download a signed exit pack with agreements, access history and exposure receipts.