Skip to content
Start free

Single Sign-On

Open in ClaudeOpen in ChatGPT

DocSpring Enterprise can sign people in with your identity provider through OpenID Connect. Okta, Microsoft Entra ID, Google Workspace, Auth0, Keycloak and most other identity providers support it. The sign-in page then shows a button for your provider next to the email and password form.

  1. In the Okta Admin Console, go to Applications > Applications and click Create App Integration. Choose OIDC - OpenID Connect, then Web Application.
  2. Set Sign-in redirect URIs to https://<your DocSpring host>/users/auth/openid_connect/callback. The host is DOCSPRING_APP_DOMAIN_NAME if you set one, otherwise DOCSPRING_DOMAIN_NAME.
  3. Under Assignments, give the app to the people who use DocSpring, then save it. Copy the Client ID and Client secret from its General tab.
  4. Set these environment variables on your install, then restart it:
SettingValue
DOCSPRING_OPENID_ISSUERYour Okta URL, such as https://example.okta.com
DOCSPRING_OPENID_CLIENT_IDThe app’s client ID
DOCSPRING_OPENID_CLIENT_SECRETThe app’s client secret
DOCSPRING_OPENID_REDIRECT_URIThe sign-in redirect URI from step 2
DOCSPRING_OPENID_CLIENT_AUTH_METHODbasic, which is how Okta expects the client secret by default
DOCSPRING_OPENID_PROVIDER_NAMEOkta, the name on the sign-in button and on each user’s linked accounts

If you use a custom authorization server in Okta, the issuer is its URL instead, such as https://example.okta.com/oauth2/default.

Register DocSpring as a web application with your provider, using the same redirect URI, and set the same variables. DocSpring asks for the openid, profile and email scopes and reads the provider’s endpoints from its discovery document at the issuer URL. DOCSPRING_OPENID_CLIENT_AUTH_METHOD is basic (an HTTP basic auth header), jwt_bearer (a signed JWT), or unset to send the client ID and secret as request parameters: use the one your provider expects.

DOCSPRING_OPENID_ICON_URL adds your provider’s logo to the button. For a provider without a discovery document, see DOCSPRING_OPENID_DISCOVERY on the Environment variables page.

DocSpring matches people by the email address your provider sends, and only uses an address the provider hasn’t marked as unverified.

  • Someone who already has a DocSpring user signs in with their password the first time, then links your provider under Your profile > Security > Linked accounts. After that, the button signs them in. With DOCSPRING_OPENID_AUTOLINK_ACCOUNTS=true, the first sign-in with the button links them instead. People who use two-factor authentication still enter their code.
  • Someone new who signs in with the button gets a user in your account when you set DOCSPRING_OPENID_AUTOJOIN_ACCOUNT_ID to your account’s ID (acc_..., on the account’s page in the admin dashboard). Without it, the sign-in page’s button doesn’t create users: invite them to your account, and they link your provider once they’ve signed in.

People can still sign in with an email address and password as well.