Skip to content

Patterns / Auth providers

Sign in with an identity provider

Candor draws the screens around sign-in. It doesn't talk to an identity provider, hold a session or store a password. Your auth library does that, and the components take plain callbacks.

SignIn (Pro) has no password field. It offers your company's SSO and a one-time emailed code. onSso is called when the SSO button is pressed, and the button only shows when you pass it. Start the redirect there with your library: Better Auth's client calls authClient.signIn.social with a provider id such as "google", and its Generic OAuth and SSO plugins cover other OpenID Connect providers. Auth.js is the other common choice; its site now says the project is part of Better Auth, so read its current guidance before starting a new app on it. onSendCode and onVerifyCode receive the email and the six digits, and whatever your server answers goes back in error, which SignIn shows under the field it concerns.

SessionExpiredDialog blocks the page when the session ends while the app is open, and signing in again returns to the same place. Pass kept only when the app really kept something, such as an unsent message. AccountState is the whole-page stop for someone who is signed in but can't use the app yet: no account, removed from one, email not verified, an invite to accept. It names who is signed in and offers Sign out, because the usual cause is the wrong email.

The components

  • Sign inProSSO button and a one-time emailed code; your server's answer comes back as `error` (Pro).
  • Session expiredProA dialog that can't be dismissed, with Sign in again and, if you pass it, Not you? Sign out (Pro).
  • Account stateProThe page for a signed-in person the app can't show anything to yet, with who is signed in and Sign out (Pro).
  • LockedFreeAn action in AccountState that stays listed but unusable, with the reason on it.

Install

With the candor-ui CLI

Each component brings in what it depends on. The free ones install as they are; Pro and Premium ones need a licence key.

Good to know

  • Left to the app: the provider configuration and secrets, the redirect and callback routes, the session cookie, token refresh, how long a session lasts, rate limits on codes, and the sentence for each failure. Candor shows what you pass and checks none of it.
  • Identity providers differ in what they send back. Decide on your server which email, name and groups you trust, and show only those.
  • Read against Better Auth's social sign-in and OAuth pages and Auth.js's OAuth page as they stood on 9 November 2026. Library APIs change; check the version you install.