Zitadel login for native mobile apps

Plan Zitadel sign-in for iOS, Android and Flutter apps: the native application type, PKCE, redirect URI choices, system browser login and refresh token handling in infrastructure you control.

On this page

How Zitadel mobile app login works and when your team needs it

Your mobile team needs customers or workforce users to sign in to an iOS, Android or Flutter app, and the identity service must be a self-hosted Zitadel that you run. A native app is a public client: it cannot keep a client secret confidential, so it uses the authorization code flow with PKCE, and the login page runs in the system browser rather than an embedded web view. Zitadel implements OpenID Connect and OAuth 2.0, which is the standard basis for this pattern, so the app receives an authorization code, exchanges it for tokens, and never holds a secret that could be extracted from the binary.

This section explains where the integration choices sit: the application type you register in Zitadel, how the redirect back into the app is handled, how tokens are stored on the device, and how sessions end. It does not walk through a vendor SDK. Mobile SDK choice, UI code and platform-specific build steps depend on your framework and release process, so treat any sample code as a starting point to verify against the Zitadel documentation for the version you run. Your team needs this planning when the app will serve more than one identity source, when it must work across several customer organizations in one Zitadel instance, or when your security review asks how tokens on a device are protected and revoked.

Before build work starts, confirm three things with your team: the Zitadel version you will run, since the current release line and upgrade notes change over time, which identity providers the app will federate with, and whether the app calls your own APIs with access tokens that those APIs must validate. Each answer changes the redirect design, token lifetimes and logout behavior covered in the rest of this page. Decide these early, because the registered application and redirect settings are hard to change once users are signing in.

Redirect and sign-in options for native apps compared

This table compares custom URI schemes, universal links and app links, and loopback or device-based sign-in for native apps. Read each row against your own app's platforms, the verification it needs and the hijacking risk it carries. Confirm the exact native application settings in Zitadel against the documentation for the version you run.

OptionWhen it fitsVerification requiredRedirect hijacking risk
Custom URI schemePrototypes, internal apps or platforms where domain verification is not availableNone at the OS level, so PKCE is mandatory and the scheme name must be unique to your appHigher: another app can register the same scheme and receive the authorization code
Universal links (iOS)Customer-facing iOS apps on a domain you controlApple App Site Association file served over HTTPS from your domain, matched to the app's bundle identifier and team ID in the entitlementsLower: only the verified app can handle links for the domain, but misconfigured association files silently fall back to the browser
App links (Android)Customer-facing Android apps on a domain you controlDigital Asset Links file on your domain listing the package name and signing certificate fingerprint, verified by the appLower: verified links open only in the matching app, but a wrong fingerprint or unverified domain falls back to a chooser
Loopback redirectDesktop or CLI-style clients with a local listener, rarely a mobile fitLocal HTTP listener on a random port, which the platform may restrict or block on mobileLow for the code itself, but mobile operating systems generally do not let apps run this listener reliably
Device authorization grantSmart TVs and input-limited devices, not standard phone sign-inUser code entered on a second device, with polling and a limit on device token lifetimeLow for phishing via redirect, but user codes can be phished, so confirm the verification page's domain
System browser login (any option)All native apps, so credentials are not entered inside an embedded web viewAuthorization request opened in the system browser, with the redirect returned to the appDepends on the redirect option chosen; the browser choice itself protects the password

How the system browser login flow moves between the app, Zitadel and the OS

The flow starts in the native app, which generates a PKCE verifier and challenge and hands the user to the operating system's system browser. The browser carries the user to the self-hosted Zitadel instance, where sign-in happens, including passkeys or a federated provider. Zitadel redirects back to the app's registered URI, and the app exchanges the code and verifier for tokens. Check that the redirect is handled by the app itself and that tokens land in device secure storage, not in the browser context.

Authorization code flow with PKCE across the app, the system browser and Zitadel.

Set up a native application in Zitadel step by step

This sequence takes a mobile team from an empty Zitadel setup to a tested native login flow for iOS, Android or Flutter. Each step produces a checkable artifact, so the team can confirm the configuration before moving on to the next layer.

  1. Confirm the instance, organization and project structure

    Before creating anything, the identity lead confirms which Zitadel instance will host the app, which organization owns its users and which project groups the application and its roles. Write these names down, because the application, the roles and the grants all sit under the project. Check that the instance is reachable over HTTPS on the domain your mobile builds will use, and that the self-hosted deployment is running a supported PostgreSQL version as listed in Zitadel's database documentation. Done when the instance console opens, the organization and project appear under the expected names, and a test administrator can sign in.

  2. Create the native application in the project

    Inside the project, create a new application and select the native application type, which Zitadel uses for installed apps that cannot keep a client secret. Give it a name that identifies the platform and environment, such as a staging build for each platform. Confirm that the authentication method is set for public clients, so the app relies on PKCE rather than a secret embedded in the binary. Done when the application shows a client ID in the console and no client secret is generated for it.

  3. Register bundle identifiers and redirect URIs per platform

    Add a redirect URI for each platform. Custom schemes take a form such as a reverse-domain scheme followed by a callback path, and universal or app links use an HTTPS URL on a domain you control. Record the iOS bundle identifier and the Android application ID and signing certificate fingerprints, because the domain association files must match them exactly. Also decide on post-logout redirect URIs now so sign-out does not fail later. Done when each planned redirect URI appears on the application, and the team has a table mapping every URI to its platform and build variant.

  4. Configure PKCE and the grant types

    Enable the authorization code grant and confirm that PKCE is required with the S256 challenge method, so the app sends a code challenge on every authorization request. Enable the refresh token grant only if the app needs offline access, and confirm the scopes include openid, profile, email and offline_access where your design calls for them. Disable grants the app does not use, such as implicit flow. Done when the application settings list the authorization code and refresh token grants, PKCE is enforced, and no unused grant types remain active.

  5. Associate the iOS and Android domain files

    For universal links on iOS, publish an apple-app-site-association file on the HTTPS domain with your team identifier and bundle identifier, and confirm the app's associated domains entitlement lists that host. For Android app links, publish an assetlinks.json file at the well-known path with the package name and the SHA-256 fingerprint of the signing certificate, and verify it with Android's app link verification tooling. Both files must be served without redirects and with the expected content type. Done when each platform's verification tool reports the domain as linked to the app, and fetching both files returns the expected content directly.

  6. Test the login on a device

    On a physical device for each platform, run a full sign-in from a clean state. The login should open the system browser or a secure in-app browser session, return to the app through the configured redirect, and complete the PKCE exchange without errors. Test a user with a password and, if enabled, a passkey, and test sign-out as well. Record the redirect behavior for a case where the app is not installed, since browsers will fall back to the web page on universal links. Done when the user lands in the signed-in state on each platform and the sign-out returns to the post-logout URI.

  7. Check token claims and refresh behavior

    Decode the ID token and access token from a test sign-in and confirm the issuer, audience, subject, expiry and the scopes and roles your API expects are present. Then use the refresh token to obtain new tokens, confirm the rotated refresh token replaces the old one, and check that the app stores tokens in the platform keychain or keystore rather than plain storage. Test that a revoked session fails the next refresh and forces a new sign-in. Done when the claims match the design, a refresh call succeeds, and a revoked session produces a clean sign-in prompt instead of a silent failure.

iOS, Android and Flutter integration paths differ in how they register redirects

On iOS, the login session is usually handled by the system web authentication session rather than an embedded web view, so the app receives the authorization response back through the redirect it registered. Teams building in Swift or Objective-C typically use the platform's web authentication session API, and the redirect can be either a custom scheme or a universal link. Universal links need an association file served over HTTPS from the domain that owns the link, plus an entitlement in the app. Confirm which SDK or library your team will use for the iOS flow, because its handling of the callback and cancellation differs.

  • Redirect type: Decide between a custom scheme and a universal link before registering the URI in Zitadel, since changing it later means updating both the app and the Zitadel application.
  • Association file: Universal links depend on an apple-app-site-association file hosted on your domain. Your platform team must own its deployment and caching.
  • Entitlements: The app's associated domains entitlement must match the domain in the association file, or the link opens in the browser instead of the app.
  • Session behavior: Confirm how the library reports a user cancelling the sign-in sheet, and how it handles a redirect that arrives while the app is backgrounded.
  • Native work: Redirect handling, entitlements and the association file are platform-native tasks that a shared codebase cannot fully replace.

Check the association file and entitlements against a clean device install before signing off the iOS flow.

Security decisions for tokens, redirects and device storage

A native app holds tokens on a device you do not control, so most of the security work sits in a few decisions: what the app never holds, how it proves each sign-in, where refresh tokens live and how they end. The cards below cover the choices to settle with your security team before the first build, and the checks to repeat on each release.

Keep client secrets out of the app

A native app is a public client, so any secret compiled into an IPA, APK or Flutter bundle can be extracted by anyone who downloads it. Register the Zitadel application as a native client without a client secret and confirm that no secret, signing key or service credential appears in the app binary, its configuration files or its build logs. Any call that needs a secret belongs on a backend you run, not on the device.

Zitadel APIs introduction

Require PKCE on every login

PKCE binds the authorization code to the app instance that started the sign-in, which protects the code when another app on the device intercepts the redirect. Decide that PKCE is mandatory for every native client, not optional per environment, and verify in your test environment that an authorization request without a code challenge is rejected. Review this setting whenever a new client is created from a copied configuration.

Store refresh tokens in hardware-backed storage

Refresh tokens grant long-lived access, so they belong in the iOS Keychain or in Android Keystore-backed encrypted storage, never in plain preferences, local databases or logs. Choose the accessibility setting for each token deliberately, since it determines whether tokens survive a device restore or remain available while the device is locked. Check that Flutter packages you depend on use these platform stores and that tokens are cleared on sign-out.

Rotate and revoke refresh tokens

Decide whether Zitadel issues a new refresh token on each use and how long a token family stays valid after a suspected theft. The app must replace the stored refresh token every time it receives a new one, and your backend or admin process must be able to revoke a session when a device is lost or a user leaves. Test both paths in a staging instance: a reused old token should fail, and a revoked session should force a new interactive login.

Validate redirect ownership on each platform

Custom schemes can be claimed by any app installed on the device, so they carry more risk than verified links. Decide per platform whether to use universal links on iOS or app links on Android, which require a domain file hosted by you, and restrict any custom scheme to a unique, non-generic name. Confirm that the redirect URIs registered in Zitadel match the bundle identifiers and the domain association files exactly.

Set a policy for rooted and jailbroken devices

Root and jailbreak detection is a signal that the device may expose tokens to other software, but detection can be bypassed and it can block legitimate users. Make the policy decision before launch: whether the app signs in on compromised devices, limits sessions with shorter lifetimes, or refuses sign-in with a clear message. Document the choice, state which signals you check, and confirm that the policy is applied in the app rather than only in a server-side report.

Refresh tokens, session length and logout on mobile

A refresh token lets a native app obtain a new access token without sending the user back through the login screen. The app stores the refresh token in the device's secure storage, exchanges it at the token endpoint when the access token expires, and keeps the user signed in across app restarts. The decision you need to make is how long that refresh token should live. A long lifetime means fewer prompts for users, but a stolen token on a lost or compromised phone stays usable for longer. A short lifetime limits that exposure, but users re-authenticate more often and support requests rise. Set the lifetime per application in Zitadel, and align it with the sensitivity of the data the app reaches through its APIs. Confirm the refresh token lifetime, idle and absolute session limits, and whether refresh token rotation is enabled in your Zitadel version before you write the app's expectations, because these settings and their defaults have changed across releases. Check the current Zitadel documentation for the settings your version exposes.

Logout on a mobile device does two different things, and the app has to do both. Clearing local tokens removes the access and refresh tokens from the device, so the app can no longer call APIs on the user's behalf. Ending the Zitadel session removes the browser session cookie held by the system browser, so the next sign-in does not silently reuse it. If the app only clears local tokens, the user can tap sign-in again and return to the account without typing a password, which may be unacceptable on a shared device. If the app only ends the Zitadel session, stale tokens may remain in storage until they expire. Use the end session endpoint with the id_token_hint parameter and a registered post-logout redirect URI, and test both steps on iOS and Android separately, since each platform handles the system browser and its cookies differently.

Propagating sign-out to other apps is a separate design problem. Ending the session in one app does not, by itself, end sessions in the other apps that share the same Zitadel login, and single logout across apps is covered on a separate page dedicated to back-channel logout. For this app, plan the local behavior first: how the app reacts when a refresh attempt fails because the session was revoked or expired, whether it returns the user to sign-in without losing unsaved work, and how it handles tokens after a device-level account removal. Write these cases into your test plan, and confirm with your Zitadel administrators how session revocation appears to a client, since the response your app receives on a failed refresh determines the behavior your users see.

Limits to confirm in your environment before building

Native mobile login with Zitadel depends on details that vary by deployment version, platform and identity provider mix. The cards below list the limits to check with Zitadel's current documentation, your platform SDK maintainers and your own app store and domain setup before you commit to a design.

Native app support in your version

Confirm that the native application type, PKCE enforcement and redirect handling behave as you expect in the exact Zitadel release you plan to deploy. Behavior around application types and redirect URI rules can change between releases, so check the release notes for the version you pin, not the latest documentation. Record the version in your design document so later upgrades trigger a fresh review of this flow.

Zitadel releases

Platform SDK compatibility

Check which OpenID Connect and AppAuth-style libraries your iOS, Android and Flutter teams plan to use, and confirm each one supports authorization code with PKCE, custom redirect schemes and the logout behavior you need. Libraries differ in how they handle discovery documents, token refresh and browser session isolation. Ask the library maintainers for the minimum platform versions they support and test on the oldest device class you must serve.

App store rules for in-app browsers

Confirm current Apple App Store and Google Play policies on login pages opened inside embedded web views, since some review guidance discourages or restricts them for sign-in. Check whether your login flow uses the system browser for authentication and whether your review team will accept it. A rejected build is costly to resubmit, so validate the policy with the review guidelines current on your submission date.

Universal and app link hosting

Verify that you can host the association files that prove ownership of your domain for iOS universal links and Android app links, and that your web server serves them without redirects or authentication. Confirm the exact file paths, content types and certificate fingerprint requirements in the platform documentation. Decide early whether custom schemes are an acceptable fallback, because each option has different hijacking risk and different setup steps.

Supported token and PKCE algorithms

Confirm which signing algorithms and PKCE challenge methods your Zitadel deployment issues for access and ID tokens, and that every mobile library and backend API you call accepts them. Mismatches show up as failed token validation, not as a login error, so they are easy to miss in early testing. Check the current algorithm list in the Zitadel documentation for your version and confirm the S256 PKCE challenge method is enforced for the native application.

Effect of customer identity providers

Confirm how each customer identity provider you federate affects the sign-in screen, including provider selection, login hints, domain-based routing and the number of steps before the user returns to the app. Organizations that use different providers can produce different screens on the same app, which affects testing scope and support load. Test each provider type on real devices, including its mobile browser behavior, before you promise a consistent experience.

Identity provider docs

Questions teams ask before building Zitadel mobile login

Can our own team build Zitadel login for iOS and Android in-house?

Yes, many teams do, and the first build is usually the smaller part of the work. Your engineers need working knowledge of OAuth 2.0 and OpenID Connect, the native application type in Zitadel, PKCE, the system browser on each platform, secure token storage and refresh behavior. The harder part is keeping the integration correct across OS releases, SDK updates and new app versions. Ask yourself whether you have an engineer who can own the identity flow for the life of the app, and whether that person can also review the Zitadel configuration and the self-hosted server. If the answer is no for either, a partner can cover the gap, with the scope set in writing before work starts.

What drives the effort of a mobile login project?

The main drivers are the number of platforms, the number of apps, and which identity features are switched on. Each additional platform (iOS, Android, Flutter) adds its own redirect handling, browser behavior and testing. Each app with its own client, scopes, roles or logout behavior adds configuration and verification. Federation with external identity providers, passkeys with password fallback, and custom branding of the hosted login each add design and test cases. Multi-tenant organizations add routing per customer. Ask for a quote that lists each of these as a separate line so you can see what changes the price if you drop one.

What do we need to provide for a mobile login build?

Plan to provide several items before work starts. You need a domain you control for the Zitadel instance and a valid TLS certificate for it, plus the redirect scheme or domain each app will use. For universal and app links, you need access to the web domain so you can host the association files. Publishing an app needs app store developer accounts, and test builds need signing identities. Testing needs test users in each identity source and, where federation is in scope, test accounts at each external provider. Confirm access to the environment where Zitadel runs, including the people who can change its configuration.

How long does a mobile login integration take?

Duration depends on the scope, and DeployOpen scopes timelines in writing for each engagement, so no general figure applies here. A single app on one platform with a standard login is a much smaller piece of work than several apps across iOS, Android and Flutter with federation, passkeys and custom branding. Waiting time also matters: app store review, certificate issuance and access to domains or test accounts often run in parallel with build work but can delay release. Ask for a timeline that separates design, build, testing and store submission so you can see where waiting may occur.

Is an embedded WebView ever appropriate for mobile sign-in?

In general, no. An embedded WebView places the sign-in page inside your app, so the app sees the user's credentials, and users cannot verify the identity provider's page or rely on their existing browser session. The usual approach is to open the system browser, which keeps the login in the identity provider's domain and lets users reuse their session and passkeys. Teams sometimes ask about WebViews for convenience or customization. If your design needs a branded experience, customize the hosted login instead and confirm with your security team how the chosen approach will be reviewed.

What ongoing work follows a mobile app release?

Each app release can change platform requirements, SDK versions, redirect handling and token lifetimes, so login needs regular checks after release. Expect ongoing work on OS and SDK updates, changes to Zitadel versions on the self-hosted side, review of refresh token behavior and logout, and re-testing when identity providers or organization settings change. Zitadel's self-hosted releases are published on GitHub, so plan for a regular upgrade cycle and test each one against your apps before rollout. Ask whether the quote includes post-release support or whether it is handled through a separate retainer.

How this page connects to the other Zitadel application guides

The native application type in Zitadel covers apps that users install on a device, so this guide is the right starting point for iOS, Android and Flutter clients that sign users in through the system browser with PKCE. The sibling guide on single-page apps is not a substitute: browser-based SPAs use the user agent application type and keep tokens in the browser, while a native app keeps tokens in platform storage and relies on the redirect URI being claimed by the app itself. Before you copy settings from one guide to the other, list every client in your estate and mark whether it runs on a device the user owns, in a browser tab, or on a server. That single list tells you which guide applies to which client and prevents a mobile app from being configured with a browser-only setup.

The device authorization flow covers a different class of client: smart TVs, command-line tools and IoT devices that cannot show a browser or accept a redirect. Zitadel supports this flow as documented in its APIs, and the sibling guide on device authorization explains user codes, polling and limits on device tokens. A mobile app should not use that flow just because it is hard to set up the redirect, because the user experience is worse and the security properties differ. If a mobile app also ships a companion CLI, treat the two as separate Zitadel application entries so that each has its own redirect URIs, grants and token lifetimes.

Once the app has tokens, the API that receives them needs its own setup. Access tokens issued to a native app are validated by the backend, and the choice between opaque tokens with introspection and JWTs validated locally, along with audience and role checks, is covered in the sibling API validation guide. Backend services that call Zitadel without a user present belong to the service account guide, which covers private key JWT, client credentials and key rotation. Confirm with your own security team which credential type each backend uses before the mobile release, because a mobile app must never hold a service account secret. Check that the audience in each access token matches the API your app calls.

How DeployOpen scopes and delivers Zitadel mobile login

DeployOpen plans and delivers Zitadel login for native mobile apps inside infrastructure you control, from the Zitadel instance and organization model through the iOS, Android and Flutter client configuration. Each engagement starts with a written scope, then moves through build, testing, documentation and handover, with ongoing support available as a retainer.

How we scope

  • Inventory the iOS, Android and Flutter apps, their sign-in flows and which Zitadel organizations and projects they belong to.
  • Record the redirect scheme choice, custom schemes or universal and app links, and the domains each one needs.
  • Agree in writing which identity providers, token lifetimes and refresh token behavior are in scope before work starts.

How we build

  • Configure native application clients in Zitadel with PKCE and the system browser login path for each platform.
  • Wire redirect handling, logout and refresh token storage in each app, using the platform secure storage APIs.
  • Test sign-in, token refresh, sign-out and account switching on real devices across the supported OS versions.

How we hand over

  • Deliver a configuration record of each Zitadel client, redirect URI, scope and token setting used by the apps.
  • Document the build steps, the app-side configuration and the test cases used to verify the login flow.
  • Walk your mobile and identity teams through operation so they can change clients and rotate settings without us.

How we support

  • Offer ongoing support, upgrades and testing as a retainer after handover, scoped to your Zitadel version and app releases.
  • Retest the login flow when the OS, the Zitadel release or the mobile SDKs your apps use change.
  • Confirm support terms, response expectations and the supported Zitadel release line in the written agreement.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.