Single Sign-On
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.
Set up Okta
Section titled “Set up Okta”- In the Okta Admin Console, go to Applications > Applications and click Create App Integration. Choose OIDC - OpenID Connect, then Web Application.
- Set Sign-in redirect URIs to
https://<your DocSpring host>/users/auth/openid_connect/callback. The host isDOCSPRING_APP_DOMAIN_NAMEif you set one, otherwiseDOCSPRING_DOMAIN_NAME. - 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.
- Set these environment variables on your install, then restart it:
| Setting | Value |
|---|---|
DOCSPRING_OPENID_ISSUER | Your Okta URL, such as https://example.okta.com |
DOCSPRING_OPENID_CLIENT_ID | The app’s client ID |
DOCSPRING_OPENID_CLIENT_SECRET | The app’s client secret |
DOCSPRING_OPENID_REDIRECT_URI | The sign-in redirect URI from step 2 |
DOCSPRING_OPENID_CLIENT_AUTH_METHOD | basic, which is how Okta expects the client secret by default |
DOCSPRING_OPENID_PROVIDER_NAME | Okta, 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.
Other providers
Section titled “Other providers”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.
How people sign in
Section titled “How people sign in”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_IDto 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.