Sign-in via Koder ID
Step diagram
User taps KoderSignInButton
UserFrom a guest screen, an auth-gated screen, or the account menu.
SDK opens OIDC authorize
SDKBuild the authorize URL with PKCE and the registered redirect_uri; open the system browser (or in-app tab on mobile).
Server resolves the identifier
ServerBare username expands to <local>@<tenant_default_domain>; an explicit @ is literal; fallback to handle if email lookup fails. Timing-safe.
User authenticates
UserPassword, passkey, or already-signed-in cookie. May require email confirmation if the account is fresh.
Server redirects with code
ServerBrowser hits /auth/callback?code=...&state=...; SDK validates state, exchanges the code for tokens.
App receives the user object
AppTokens persist in the platform secure store; the original screen rebuilds with the new auth context.
Common pitfalls
- Storing the access token in localStorage instead of the platform secure store — leaks across origins on shared devices.
- Skipping state validation on the callback — opens the door to CSRF on the auth code.
- Sending the OIDC redirect to a non-canonical host (app.<produto>.koder.dev) — breaks every callback that was registered for <produto>.koder.dev.