Skip to main content
The previous pages cover what a person using MaihueGO goes through. This page gathers the platform pieces that share the same domain (authenticate, ADR 0131) and that an operator or an integrating team needs to know. Each section is short and links to the full documentation when it already exists.

Identity provider (IdP)

The B Brands IdP is the holding’s OAuth 2.1 / OpenID Connect provider. It only authenticates: it answers who the person is and whether they are enabled for a platform (Odoo first; then CRM, analytics and partners). It uses Supabase OAuth 2.1 Server as the engine behind a horizon-api facade, with the environment’s canonical auth.* issuer. It has two route families in horizon-api: Discovery lives at the app root: GET /.well-known/openid-configuration and GET /.well-known/jwks.json.
rotate-secret rotates the provisioning webhook secret, not the OAuth client_secret. client_secret rotation does not exist yet (see Security and limits). As of 2026-09-23, Odoo is registered in development only.
The detail lives in the Documentation tab and is not repeated here:

OAuth & Identity (IdP)

What the IdP is, its layers and decisions.

OAuth / OIDC Endpoints

Discovery, JWKS, authorize, consent, token, userinfo and revoke.

Token Exchange

From the OIDC id token to the internal B Brands JWT.

Client Integration

How a platform connects as an OAuth client.

Sign-in app: horizon-authenticate

horizon-authenticate is the one place where B Brands people sign in on the web (https://auth.bbrands.io in production, https://<environment>.auth.bbrands.io elsewhere). It is a Next.js 16 app with next-intl and a split layout with a brand panel (hidden below the lg breakpoint). Locales. es and en. The fr, it and pt routes are retired and redirect temporarily to the same path under es. A URL without a locale redirects to the visitor’s locale. Hand-off to next. When sign-in ends (password, provider or link), the app goes through the 2FA gate and redirects to the requested next. It only accepts targets in AUTH_ALLOWED_REDIRECT_HOSTS. The *.bbrands.io apps read the session through the auth/session bridge; apps on other domains (for example *.maihuego.com) receive the bbx exchange. The detail is in Session.
Pending. The 2FA gate exists, but the authenticate-two-factor-ui flag is still false in every environment and there is no second-factor backend. No second factor is requested today.

Machine authentication

Two mechanisms that do not involve MaihueGO end customers: Limits: login-worker 10 per 10 min per IP; login-worker-document 5 per hour per user and IP, always enforced.
Pending (T-112, p0). Rotating CRON_SECRET in every environment after the F-024 exposure is in progress.

Authentication events

Supabase Auth notifies horizon-api in two ways: Authentication notification catalogue (lib/notification/event/registry/auth.events.ts). None can be opted out of; security notifications ignore quiet hours. Migration 0417_notification_event_catalog_authenticate.sql seeds these keys. Apple notifications (consent revoked, relay off) send no e-mail: they revoke sessions or mark the channel unavailable (see Sign in with Apple).

Better Auth migration

Goal. Replace Supabase Auth (GoTrue) with Better Auth embedded in horizon-api on our own Postgres, as an engine transplant that keeps the contracts and the user UUIDs. The driver is cost: at 1 million MAU, GoTrue would cost about USD 2,925 per month. Status as of 2026-09-23.
  • The documentation is GO. Wave 0 on the current engine is built, deployed and certified (v3 routes, 2FA gate, Horizon Enterprise on v3, route telemetry); its gate is still formally open.
  • Better Auth itself does not exist yet. The credential cutover, the IdP engine and the GoTrue decommission are NO-GO; the IdP engine is blocked by advisory GHSA-p2fr-6hmx-4528.
  • Account-centric identity goes first.
Nothing changes for MaihueGO today: everything described in this section runs on Supabase Auth.

See also