Authentication & SSO
Authentication is handled by Better Auth, stored in your MongoDB. Out of the box, Imprime offers:
- Email & password sign-up and sign-in — always enabled;
- Google, Microsoft and GitHub SSO — each enabled when its credentials are set;
- API keys for scripts, and OAuth 2.1 for MCP clients — always enabled.
The login page only shows the providers that are configured.
Single sign-on
Section titled “Single sign-on”Every provider asks for a redirect / callback URL. It is always:
<PUBLIC_APP_URL>/api/auth/callback/<provider>-
In the Google Cloud console, create an OAuth client ID of type Web application.
-
Authorized JavaScript origins:
https://imprime.example.com -
Authorized redirect URIs:
https://imprime.example.com/api/auth/callback/google -
Set the credentials:
GOOGLE_CLIENT_ID=…apps.googleusercontent.comGOOGLE_CLIENT_SECRET=GOCSPX-…
-
In the Microsoft Entra admin center, go to App registrations → New registration.
-
Redirect URI (platform Web):
https://imprime.example.com/api/auth/callback/microsoft -
In Certificates & secrets, create a client secret.
-
Set the credentials.
MICROSOFT_TENANT_IDrestricts who can sign in:common(any account),organizations(work/school),consumers(personal) or your tenant ID (your organization only).MICROSOFT_CLIENT_ID=00000000-0000-0000-0000-000000000000MICROSOFT_CLIENT_SECRET=…MICROSOFT_TENANT_ID=common
-
In GitHub, go to Settings → Developer settings → OAuth Apps → New OAuth App.
-
Homepage URL:
https://imprime.example.com -
Authorization callback URL:
https://imprime.example.com/api/auth/callback/github -
Generate a client secret and set the credentials:
GITHUB_CLIENT_ID=Iv1.…GITHUB_CLIENT_SECRET=…
Restart the app after changing the configuration (docker compose up -d).
Email verification
Section titled “Email verification”To make sure users own the email they sign up with:
REQUIRE_EMAIL_VERIFICATION=trueSMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_USER=no-reply@example.comSMTP_PASS=…SMTP_FROM=Imprime <no-reply@example.com>A verification link is sent on sign-up; clicking it verifies the address and signs the user in.
MCP OAuth
Section titled “MCP OAuth”Nothing to configure: the OAuth 2.1 authorization server for MCP clients is built in. It publishes its metadata at:
<PUBLIC_APP_URL>/.well-known/oauth-authorization-server<PUBLIC_APP_URL>/.well-known/oauth-protected-resourceMake sure your reverse proxy forwards /.well-known/* to Imprime, and that PUBLIC_APP_URL is
the exact public HTTPS origin — clients use it to find the authorization server.