clauth github ↗ Get started

Docs · Sign-in providers

Let people sign in with Google, Microsoft, Okta or Apple

Each guide takes about ten minutes. You create an app at the provider, give it Clauth's redirect URL, then paste the ID and secret it gives you into Clauth. People then see a "Continue with …" button on the sign-in page.

Before you start

  1. In Clauth, open Organizations › your organization › Settings › Sign-in providers & senders (or, for everyone, Settings › Add provider). Under Add a connection, press Add on Sign-in provider.
  2. Pick the provider. The dialog fills in what it can and shows the redirect URL, for example https://app.helloclauth.com/login/c/acme-google/callback. Copy it: the provider needs it first.
  3. Keep the dialog open, do the steps below in another tab, then paste the values back and press Add.

The redirect URL comes from the name you type (Google → …/acme-google/callback). If you change the name, copy it again. After adding, Clauth shows it on the connection's Manage screen, and Check tests the settings without signing in.

Google (Gmail and Google Workspace)

You need a Google account that can create a project in Google Cloud. It's free.

  1. Go to console.cloud.google.com and create a project (top bar › project picker › New project), e.g. "Acme sign-in".
  2. Open APIs & Services › OAuth consent screen (shown as Google Auth Platform in newer consoles) and fill in Branding: app name, support email, and your logo if you want one.
  3. Under Audience, choose Internal if only your Google Workspace accounts should sign in, or External for any Google account. For External, press Publish app so it isn't limited to test users. Clauth only asks for openid email profile, which needs no Google review.
  4. Open Clients (or Credentials › Create credentials › OAuth client ID) › Create client › Application type Web application.
  5. Under Authorized redirect URIs, add Clauth's redirect URL exactly as shown. Leave "Authorized JavaScript origins" empty. Press Create.
  6. Copy the Client ID and Client secret into Clauth. Issuer is https://accounts.google.com and scopes openid email profile (both already filled in).

Only your company? Also list your domain (e.g. acme.com) under Email domains of your people in Clauth.

Microsoft (Entra ID / Microsoft 365)

You need an account that can register apps in your Microsoft Entra tenant (usually an admin).

  1. Go to entra.microsoft.com › Applications › App registrations › New registration.
  2. Name it (people may see this name), and under Supported account types choose Accounts in this organizational directory only.
  3. Under Redirect URI pick platform Web and paste Clauth's redirect URL. Press Register.
  4. On the overview, copy the Application (client) ID and the Directory (tenant) ID.
  5. Open Certificates & secrets › New client secret. Copy the secret's Value (not the "Secret ID") right away; it's shown once. Note the expiry date: you'll need a new one then.
  6. Recommended: Token configuration › Add optional claim › ID › email, so the sign-in carries the email address.
  7. In Clauth: issuer https://login.microsoftonline.com/<tenant-id>/v2.0 with your Directory (tenant) ID in place of <tenant-id>; client ID and secret from above; scopes openid email profile.

Okta

  1. In the Okta Admin Console open Applications › Applications › Create App Integration.
  2. Choose OIDC - OpenID Connect and Web Application.
  3. Set Sign-in redirect URIs to Clauth's redirect URL. Grant type Authorization Code (the default).
  4. Under Assignments, choose who may use it (everyone, or certain groups). Press Save.
  5. Copy the Client ID and Client secret into Clauth.
  6. Issuer is your Okta address, e.g. https://acme.okta.com. If your Okta uses a custom authorization server, use its issuer instead (e.g. https://acme.okta.com/oauth2/default).

Apple

You need an Apple Developer Program membership (paid) and access to Certificates, Identifiers & Profiles. Apple doesn't use a plain secret: Clauth signs a short-lived one with a key you download.

  1. Go to developer.apple.com › Identifiers. If you don't have an App ID yet, create one (type App IDs) and tick Sign in with Apple.
  2. Create a Services ID (Identifiers › + › Services IDs), e.g. com.acme.signin. This is the client ID in Clauth.
  3. Open the Services ID, tick Sign in with Apple › Configure: choose your App ID as the primary one, add Clauth's host under Domains and Subdomains (e.g. app.helloclauth.com, no https://) and Clauth's redirect URL under Return URLs. Save.
  4. Open Keys › +, name it, tick Sign in with Apple › Configure › choose the same App ID. Register, then Download the .p8 file. Apple lets you download it once: keep it somewhere safe.
  5. Note the key's Key ID (10 characters) and your Team ID (top right of the developer site, 10 characters).
  6. In Clauth pick Apple and fill in the Services ID, Team ID, Key ID, and paste the whole .p8 file (from -----BEGIN PRIVATE KEY----- to the end). Press Add, then Check.

Good to know: Apple sends the person's name only the first time they sign in. People may choose Hide My Email, so the address can be …@privaterelay.appleid.com. Such people won't match an existing account by email; they can link Apple from My account after signing in another way.

Other OpenID Connect providers

Any provider that publishes /.well-known/openid-configuration works (Auth0, Keycloak, OneLogin, Ping, another Clauth…).

  1. Create a web application (confidential client) at the provider, with Clauth's redirect URL as the redirect / callback URL and the authorization code flow.
  2. In Clauth enter the issuer URL (the address before /.well-known/openid-configuration), client ID and secret, and scopes openid email profile.
  3. Press Check: it reads the provider's discovery document.

Providers without OpenID Connect (plain OAuth 2) use the OAuth 2 provider card instead, where you enter the authorize, token and user-info URLs.

Options in Clauth

OptionWhat it does
Show a button on the sign-in pageAdds "Continue with …". Turn off to keep it only for people sent there by their email domain.
Link to an existing Clauth account with the same emailSomeone who already has an account with that (verified) email is signed in to it. Otherwise they must link the provider from My account first.
Email domains of your peopleOrganization providers only sign in people with these email domains.
Create accounts for new peopleSomeone from those domains without a Clauth account gets one on first sign-in.
People with these email domains must sign in this wayTyping an @acme.com email sends them to this provider instead of asking for a password.

If it doesn't work

  • "redirect_uri_mismatch" or similar: the redirect URL at the provider must match Clauth's exactly, including https:// and no trailing slash.
  • Check fails: the issuer is wrong. Open <issuer>/.well-known/openid-configuration in a browser; it should show JSON.
  • "Sign in another way first": an account with that email exists but linking by email is off. Turn on the linking option, or link the provider from My account.
  • Microsoft stops working after months: the client secret expired. Make a new one and paste it in (leave other fields as they are).
  • Apple says "invalid_client": the Services ID, Team ID, Key ID or key don't belong together, or the key wasn't enabled for Sign in with Apple.

Still stuck? Ask in Discussions.