Two ways to sign in with a provider
Behaviour per platform
- iOS · native Apple
- App · browser
- Web
1
Nonce
The app generates a random nonce with
expo-crypto and sends its SHA-256 to Apple.2
Native sheet
Apple returns
identity_token, authorization_code and, only on the first authorization,
the first and last name.3
horizon-api
The app calls
POST /api/v3/auth/login/oauth/apple with the raw nonce. horizon-api signs in
with signInWithIdToken, exchanges the authorization_code and stores the refresh token
encrypted.4
Result
Existing account → Home. New login → registration without a password (see
Registration).
The provider footer in MaihueGO
- Buttons are always ordered Google, Apple, Microsoft, and only the enabled ones are shown, packed together with no gaps.
- The 240 pt slot is held even when there are no buttons, so the screen does not jump.
- With every provider off, the block stays mounted at
opacity:0, is not tappable and is hidden from screen readers. - While a sign-in is in progress, every button is disabled.
- During sign-in an “entering the app” overlay is shown. Home, the courtesy screen, the Android back button or a 20-second failsafe timer dismiss it.
Per-provider flags
One flag applies to every platform (ADR 0133). The old keys
maihuego-application-oauth-apple,
-google and -microsoft are deleted by the Capacidades Sync in Horizon Enterprise; app versions older
than 2026.11.3 do not read the new keys and show no provider until the forced update moves them.
How the app evaluates them
How the app evaluates them
GET /api/v3/feature-flag/evaluate?category=authenticate(public, answers a key-to-boolean map), on mount and when returning to the foreground, except during an OAuth flow in progress.- It stores the last successful evaluate in AsyncStorage; if an evaluate fails, it keeps the previous one. A missing key counts as off.
- It never sends
FEATURE_FLAG_SERVER_TOKEN: only theAcceptandCache-Control: no-storeheaders. - Buttons are hidden without unmounting the block.
How the web evaluates them
How the web evaluates them
horizon-authenticate evaluates on the server and only renders the enabled buttons. horizon-api also
filters
verify-email’s providers with the same flags (enabledOauthProviders()), which fail
closed: an evaluation error counts as off.Clean install and effect of a change
Clean install and effect of a change
A clean install, or the first launch after updating, shows no provider until the first
successful evaluate. A flag change shows up at the next evaluate, without shipping anything. If a
tester still sees the old state, they should force-close the app and open it again.
Everyday cases
Each callback accepts only a session that holds its provider’s identity (
google for Google,
azure for Microsoft); app_metadata.provider is not enough.
Endpoint contracts
The start, callback and native Apple routes are public, each with its own rate-limit policy.
oauth/register, oauth/complete and oauth/welcome require the session of the login they act on.
In progress. The
redirect_url allowlist exists per environment
(config/social-login/redirects.<environment>.json) behind the server flag
security-social-redirect-enforce (it replaced AUTH_SOCIAL_REDIRECT_ENFORCE in 2026.11.2); with
false it only logs. The 2026.11.2 Sync seeds it true in every environment. Making it mandatory is tracked in security-hardening (T-105).