Skip to Content
BricoleDocs

Configure sign-in

Choose email codes, Cloudflare Access or OpenID Connect, connect the provider, and verify who can sign in.

Each host selects one browser sign-in method in identity.provider. Start from the installation guide and keep your operator file outside the Bricole checkout. The public entry point is /auth/sign-in. Bricole handles the return to the requested page after sign-in.

ProviderChoose it whenServices to provision
emailPeople should sign in with a code sent to their email address.Private identity Worker, D1 database, verified Email Sending domain.
accessA Cloudflare Zero Trust application already controls who can sign in.Access application and policy. Add the private identity Worker, D1 and sender if you also want invitations by email.
oidcYour organization has an OpenID Connect issuer and can register a confidential client.Private identity Worker, D1, OIDC client and client secret. Add a sender if you also want invitations by email.

Email codes

Copy packages/operator/bricole.example.jsonc. Keep the following shape under identity, substituting your Worker name and verified sender.

{
  "provider": "email",
  "service": { "worker": "bricole-identity", "secret": { "secret": "AUTH_SECRET" } },
  "email": { "from": "sign-in@notify.example.com" }
}

Enable Email Sending for the sender domain using the command printed by operator check. The installer applies the identity migrations, binds the sender as EMAIL and provisions the Worker secret. Store the returned D1 ID under identity.service.database for upgrades. Give each host its own identity Worker and database.

To verify delivery, open the host’s sign-in page, enter an address you control and submit the six-digit code from the message. A code expires after five minutes. Resending an unused code extends that window. A successful confirmation consumes the code and starts a Bricole session. Open Settings to verify the signed-in account. Wrangler local development delivers the message to a local file; production requires a working mailbox and sender domain.

Cloudflare Access

Create a self-hosted Access application on the host’s /auth/access path only, for example bricole.example.com/auth/access. Configure who may sign in through its Access policies. Copy the Access application audience tag and team domain into the operator file.

{
  "provider": "access",
  "access": {
    "teamDomain": "https://example.cloudflareaccess.com",
    "audience": "your-application-audience-tag",
    "emailVerified": false
  }
}

The deployer provisions ACCESS_TEAM_DOMAIN and ACCESS_AUD on the host. The host validates the Access assertion against that team’s signing keys, issuer and audience. Open /auth/sign-in, complete the Access challenge, and check that you return to Bricole. A signing-key service outage can produce a retryable 503.

The default for emailVerified is false. Set it to true only when every enabled login method on the Access application verifies the user’s email address. This setting allows that address to claim invitations and match the creator allowlist. For invitation delivery, also configure identity.service and identity.email.from as in the email example. The host continues to use Access for sign-in.

OpenID Connect

Copy packages/operator/bricole.oidc.example.jsonc. Keep identity.service, set identity.provider to oidc and configure your provider’s client under identity.oidc.

{
  "issuer": "https://login.example.com/realms/team",
  "clientId": "bricole-host",
  "clientSecret": { "secret": "OIDC_CLIENT_SECRET" }
}
  1. Register the client at your provider. Use the exact HTTPS issuer from its discovery metadata, the scopes openid email and the redirect URI https://bricole.example.com/auth/oidc/callback/oidc, replacing the hostname with your own.
  2. Supply OIDC_CLIENT_SECRET through the deployment environment for the initial upload. The operator file contains only its secret reference. An upgrade reuses the secret already held by the identity Worker. To rotate it, use the operator’s Wrangler pass-through to run secret put OIDC_CLIENT_SECRET --name <identity-worker>.
  3. Open the host’s sign-in page and complete the provider’s challenge. Check that Bricole returns you to the intended page. An invitation claim requires an ID token with an email and the boolean claim email_verified: true; an account can sign in using its subject even when the ID token omits email.

Directory and organization policies

Manage who may authenticate in your upstream Access policy or OIDC provider. Once someone signs in, Bricole assigns host and artifact permissions to its own actor ID. The operator schema offers no native SAML provider, SCIM provisioning endpoint, group-to-role mapping or organization-wide email-domain role rule. If your upstream service federates another identity system, configure that federation there and connect Bricole through one of the three supported methods. For offboarding, disable the actor in Bricole as well as applying your upstream policy.

Verify a configuration or change providers

Run the following from the repository root against the operator file you intend to use.

bun run operator check --config ../my-host/bricole.jsonc

Read the selected provider, Worker bindings, required secret names, and manual setup steps. This check builds the Workers locally. Complete a real sign-in separately to verify provider delivery, policy or callback registration.

Bricole links an identity by issuer and subject. Equal email addresses across providers can correspond to different Bricole actors. Changing issuer can therefore leave a person’s existing grants on their previous actor. Inventory actors and grants, plan how existing owners will keep access, and review the deployer’s binding-change refusals before changing providers. An upgrade that would require a new or replacement identity service requires separate installation planning.

New people start as members. The first administrator claims /setup with the one-time code. An admin grants host roles explicitly. The optional host secret CREATORS contains comma-separated verified addresses, matched case-insensitively at sign-in. A match promotes a member to creator; removing an address leaves the existing role in place. Demote the actor explicitly when needed. Each browser session ends within one day or earlier when bounded by the provider. See roles, agent credentials and sharing for access after sign-in.