Skip to content

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.

Every provider asks for a redirect / callback URL. It is always:

<PUBLIC_APP_URL>/api/auth/callback/<provider>
  1. In the Google Cloud console, create an OAuth client ID of type Web application.

  2. Authorized JavaScript origins: https://imprime.example.com

  3. Authorized redirect URIs: https://imprime.example.com/api/auth/callback/google

  4. Set the credentials:

    GOOGLE_CLIENT_ID=…apps.googleusercontent.com
    GOOGLE_CLIENT_SECRET=GOCSPX-…

Restart the app after changing the configuration (docker compose up -d).

To make sure users own the email they sign up with:

REQUIRE_EMAIL_VERIFICATION=true
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=no-reply@example.com
SMTP_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.

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-resource

Make 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.