Runbooks
Mobile sign-in with ZITADEL
Create a native OIDC client in the same ZITADEL project as the API. Register an exact callback URI owned by the app, prefer a verified HTTPS application link, and use authorization code with PKCE S256. Configure JWT access tokens and request the API project audience. Keep the native client public.
- Use the system browser and the platform's OIDC library to start the flow. Generate a fresh verifier, state and nonce for every attempt.
- Validate the callback with the library and exchange the code with the
original verifier. Request the scope
urn:zitadel:iam:org:project:id:<api-project-id>:audandurn:zitadel:iam:org:project:id:<api-project-id>:rolesalong withopenid. - Send the access token as
Authorization: Bearer <token>toGET /meandPOST /graphql. Use the stable application ID returned by/me. - Keep credentials in OS-protected storage. On sign-out clear local credentials and revoke refresh tokens when issued. Reauthenticate after token expiry or failed refresh.
Use a different client registration for the browser BFF. Treat the API audience as a resource identifier separate from either client ID.