This article explains how to implement passkeys in native iOS / Android apps. You learn when to use a native and when to use WebView (+ type) implementation.

Vincent
Created: October 9, 2023
Updated: October 8, 2025

Passkeys Series: Native Apps
Our mission is to make the Internet a safer place, and the new login standard passkeys provides a superior solution to achieve that. That's why we want to help you understand passkeys and its characteristics better.
Modern mobile platforms give you two main approaches to integrate passkeys into an app: via fully native implementation or using a WebView embedded in the app. Let’s first clarify the differences and see how the two approaches compare in terms of user experience, security and development effort.
A native passkey implementation provides the best user experience, with authentication flows built directly into your app's UI. Users benefit from platform-native dialogs, seamless biometric verification and the fastest possible login times.
Platform Requirements for Native Passkeys:
Before diving into platform specifics, understand that native passkey integration requires cryptographic trust between your app and web domain. Without it, the OS will reject all WebAuthn operations. Both platforms require:
app:// URL)The benefit is that passkeys created on your website work in your app and vice versa.
Implementing passkeys natively on iOS involves Apple's AuthenticationServices framework, which provides an API for WebAuthn operations:
Key Components:
ASAuthorizationController: Manages the authentication flowASAuthorizationPlatformPublicKeyCredentialProvider: Creates passkey requestsDevelopment Tips
?mode=developer to your AASA URL to force fresh fetchesexcludeCredentials (allowing duplicate passkeys). Fixed in 17.5, but
highlights the need to test across iOS versionsAndroid's native passkey implementation uses the Credential Manager API (or the older FIDO2 API for backward compatibility):
Key Components:
CredentialManager: Central API for all credential operationsCreatePublicKeyCredentialRequest: For passkey registrationGetCredentialRequest: For passkey authenticationNote: Android currently lacks iOS's Conditional UI keyboard suggestions in native apps (though Conditional UI works in web apps)
Implementing passkeys natively has important challenges and lessons learned: Integrating at the OS level can surface issues across different devices and OS versions.
While you can implement passkeys using raw platform APIs, purpose-built SDKs significantly accelerate development by handling WebAuthn complexity, edge cases and providing built-in telemetry. SDKs also offer mockable interfaces for unit testing (crucial since you can't test biometrics in simulators).
Recommendation: For native implementations, we recommend using the Corbado SDKs (iOS Swift Passkey SDK, Android Kotlin Passkey SDK) which handle the numerous edge cases discovered through production deployments, provide additional telemetry and testing.
Igor Gjorgjioski
Head of Digital Channels & Platform Enablement, VicRoads
Corbado proved to be a trusted partner. Their hands-on, 24/7 support and on-site assistance enabled a seamless integration into VicRoads' complex systems, offering passkeys to 5 million users.
Passkeys that millions adopt, fast. Start with Corbado's Adoption Platform.
Start Free TrialWhen developing a mobile app, going fully native for passkeys is ideal for UX but it isn't always possible or practical, especially if you have to support existing authentication methods. In scenarios where your app still needs to accommodate password logins or federated SSO (e.g. an OAuth2-based workflow), a full native passkey integration may not cover all use cases. In such cases, using an in-app WebView to handle authentication can be a viable alternative. A WebView is essentially an embedded browser window within your app. It allows you to leverage web-based passkey flows (just as on a website) while keeping the user inside your app's UI shell.
WebViews act as a bridge, embedding your web login pages directly inside the app and providing a browser-like experience. This is particularly useful if your current solution already has a web-based login (with passwords or social logins) or if you rely on third-party IdPs. For example, if you are an OAuth2 provider or use SSO/social login providers like Google or GitHub, you often must handle those flows via web pages. In these cases, a WebView becomes necessary to display those web authentication screens. The WebView route ensures you can still introduce passkeys without rebuilding your entire auth stack natively – the web code (which could use WebAuthn JavaScript for passkeys) runs inside the WebView. The user experience is slightly less seamless (it feels more like a browser interaction), but it keeps all login methods in one place.
In essence, while native passkey implementations offer the most integrated experience, they require your app to be ready for a passwordless paradigm. WebView implementations provide flexibility and let you piggy-back on a web passkey flow inside the app. This is why many apps choose WebView as a stepping stone: it allows adding passkey support relatively quickly by reusing web logic, at the cost of a UX trade-off (the embedded browser context). Notably, major tech companies have taken this approach initially – for example, Google and GitHub added passkey login to their apps via WebView overlays on their existing web auth pages. This approach works well as an interim solution when a fully native rebuild of auth flows is not feasible upfront.
If you decide to implement passkeys via a WebView in your app, you'll need to choose the type of WebView carefully. Both iOS and Android offer multiple WebView components, each with its own characteristics. It's important to use a WebView that supports WebAuthn/passkeys properly and provides a good balance of security and user experience.
On iOS, you generally have three options for displaying web content in-app:
On Android, the main choices are:
android.webkit.WebView), which is
essentially a mini browser that can be embedded in your activities. It's highly
customizable but runs in your app's process.In the following sections, we'll delve a bit deeper into these WebView types for iOS and Android, and discuss which might be best suited for passkey authentication flows.
Apple's platform provides the three WebView options listed above. Your choice will affect how smoothly passkeys can be used inside the app:
For testing the different WebView behavior in iOS, we recommend the app WebView - WKWebView and UIWebView rendering.
WKWebView is a versatile WebView component for iOS. Developers can embed a WKWebView to render web content with a high degree of control over the UI and behavior. WKWebView uses the same rendering engine as Safari, so it's very performant and supports modern web features. In theory, WKWebView can handle WebAuthn (and thus passkeys) if configured correctly, but note that some advanced browser features might be restricted for security. One thing to watch out for is that WKWebView by default does not share cookies or keychain data with Mobile Safari. Users might have to log in afresh because their WebView session is isolated from Safari's session. Also, because WKWebView content can be fully customized by the app, the user doesn't see an address bar or Safari UI – which is great for branding, but it means the user has fewer cues to verify the page's legitimacy (a concern for anti-phishing). Some apps have even abused WKWebView to inject scripts or alter content (e.g. TikTok was noted to inject tracking JS via their in-app browser), so one must be careful to use WKWebView in a safe, user-trustworthy manner.
SFSafariViewController provides an in-app Safari experience. When you open a URL with SFSafariViewController, it's almost like opening it in the real Safari browser, except the user stays within your app's UI. The advantage for passkeys is huge: because it's essentially Safari, the user's iCloud Keychain, saved passkeys, cookies, and other Safari data are accessible. This means if the user already has a passkey for your site, Safari can find it and even display the Conditional UI autocomplete for easy login. SFSafariViewController is less customizable (you can't change its toolbar much), but it automatically handles a lot of security and privacy features. The URL bar is shown, complete with the padlock icon for HTTPS, which gives users confidence they're on the correct domain. In general, SFSafariViewController is considered more secure than a raw WKWebView and is simpler to implement (Apple provides it as a drop-in). The main trade-off is you sacrifice some control over the look & feel. For an authentication flow, that's usually acceptable. The priority here is security and ease of login, which SFSafariViewController excels at by using Safari's context.
| WKWebView | SFSafariViewController | |
|---|---|---|
| User experience | - Native feeling: Users might feel that the web content is a native part of the app because developers can customize the look and feel to match the app's design. - Autofill: Autofill with data from Safari is possible | - Seamless: Seamless user experience using the user's Safari settings ensuring consistent web browsing between native app and browser. |
| Developer experience | - Highly customizable: Extensive customization and configuration available - Flexible: Many APIs for interacting with web content | - Medium customizable: Limited customization options, especially compared to WKWebView, - Simple: Simpler to implement compared to WKWebView |
| Performance | - Rather slow: Depending on the implementation and web content, loading speeds can be optimized, but might still be slower compared to SFSafariViewController due to the additional processing of custom features and interactions. | - Rather fast: Typically offers better performance as it leverages the Safari engine, which is optimized for speed and efficiency, providing fast loading times for web pages. |
| Trust and recognition | - URL Display not required: WKWebView often doesn't show the URL, making it harder for users to verify the webpage. Potential for malicious apps to mimic this behavior and phish credentials. | - Browser-like Experience: Renders web pages using Safari, providing a "browser-like" experience. Users can see the URL and access Safari's auto-fill features, potentially instilling more trust due to the familiar interface. |
| Isolation | - Separated: Cookies and sessions are separated from Safari; users won't be automatically logged into a WKWebView. | - Separated: Cookies and sessions are separated from Safari; users won't be automatically logged into SFSafariViewController either. |
| Vulnerabilities | - Secure: Inherently secure due to Apple's app sandboxing, but on behavior and security depend the app's implementation. Potential vulnerabilities if not implemented correctly. | - More Secure: Benefits from Safari's built-in security features, including anti-phishing and malicious website warnings. Generally considered more secure for displaying web content than WKWebView due to these features and user familiarity with Safari. |
| Other | - Features not available: Some browser features (e.g., WebAuthn) may not be fully accessible due to security concerns and WKWebView running in the application context. - JavaScript injection: Some apps, e.g. TikTok inject tracking JavaScript into their in-app WKWebView, or restrict user controller (e.g. Facebook) - Privacy issues: More community feedback regarding privacy | - No JavaScript injection: Does not allow the execution of JavaScript from the app, enhancing security and privacy. Also it does not support JavaScript alerts or confirmations, potentially impacting user experience on certain web pages. - Reader Mode: Provides a reader mode for a clean, easy-to-read version of articles. |
SFAuthenticationSession / ASWebAuthenticationSession – These classes (the latter being the newer Swift-friendly name) are built specifically for login flows like OAuth or OpenID Connect. When you need to authenticate a user via a web page (perhaps to an external IdP), these sessions are the recommended choice on iOS. They are very similar to SFSafariViewController in that they utilize the Safari browser under the hood and share cookies/storage with Safari. The key difference is that SFAuthenticationSession will always prompt the user that the app wants to authenticate using a webpage (for user awareness) and it will automatically use the user's existing Safari session if available.
Ephemeral Mode Considerations: ASWebAuthenticationSession includes a
prefersEphemeralWebBrowserSession property. When set to true, it creates an isolated
browser session with no access to Safari's cookies or saved credentials. This is useful
for sign-out flows or guest checkouts where you explicitly don't want
SSO, but it means passkeys stored in
iCloud Keychain won't be available. The trade-off: enhanced
privacy vs. convenience. Most passkey implementations should keep this false (the
default) to enable seamless authentication.
The benefit is a seamless SSO experience – if the user is already logged in to the provider in Safari, this session can use that cookie to avoid another login. For passkeys, this is important because it means any passkey credential stored in Safari/iCloud Keychain can be used here as well. Apple's official guidance is to use ASWebAuthenticationSession for anything that looks like a login flow. The pros are enhanced privacy (your app never sees the credentials or cookies, Safari handles it) and built-in SSO support. The con is that it's limited to auth flows (you wouldn't use it to just render arbitrary web content in your app). In summary, if your app falls into Group B (see Section 5) and you choose a WebView approach on iOS, ASWebAuthenticationSession is typically the best choice for implementing passkeys because it's secure, shares state with Safari (so passkeys work), and is purpose-built for authentication.
On Android, the WebView decision is between the classic WebView and Chrome Custom Tabs:
For testing the different WebView behavior in Android, we recommend the app WebView vs Chrome Custom Tabs.
Android WebView (android.webkit.WebView) is a component that lets you embed web pages in your activity layout. It's similar to WKWebView in that it gives you full control: you can intercept navigation, inject JavaScript, customize the UI, etc. It also runs within your app's process. Using a WebView for passkeys means your app loads your web login page, and that page can initiate a WebAuthn passkey ceremony. Modern Android WebView does support WebAuthn (provided the device's WebView implementation is up to date via Android System WebView or the Chrome component). One major consideration: by default, an Android WebView does not share cookies or stored credentials with the user's Chrome browser. So any passkey created or used in the WebView might not be known to Chrome, and vice versa. This isolation can be good for security (your app can't read browser cookies), but it might force users to log in again if they've already authenticated in Chrome. Another issue is trust. A plain WebView doesn't show the URL or SSL lock icon, so users have to trust your app completely not to phish them. Google has even forbidden use of WebView for Google OAuth sign-ins due to potential phishing risks. Performance-wise, WebViews are fine, but they can be slower or more memory-intensive than using the user's default browser, especially if loading heavy pages.
Chrome Custom Tabs (CCT) are a hybrid approach. They allow your app to open a Chrome-rendered page that looks like it's part of your app. You can customize the toolbar color, add an app logo, etc., but the content is rendered by Chrome in a separate process. For passkeys, CCTs have several benefits: they share the user's cookies and credentials with Chrome, meaning if the user has a passkey saved via Chrome (Google Password Manager), the Custom Tab can access it. The user will also see the actual URL and security indicators, which builds trust. Performance is often better – Chrome can be "warmed up" in the background for faster loading. And importantly, security is strong: because it's essentially the Chrome app, things like Google Safe Browsing protect the session, and your app cannot inject arbitrary scripts into the page (preventing certain attacks).
2025 Update - Ephemeral Custom Tabs: Chrome now supports Ephemeral Custom Tabs via
CustomTabsIntent.Builder().setShareState(CustomTabsIntent.SHARE_STATE_OFF). This creates
an incognito-like session with no cookie persistence – useful for guest flows or explicit
sign-outs. However, like iOS's ephemeral mode, this
means stored passkeys won't be accessible. Use standard (non-ephemeral) Custom Tabs for
passkey authentication to maintain access to saved credentials.
The downside is that it requires the user to have Chrome (or a supported browser) installed and up-to-date. Most Android users do, but on some devices in certain regions, this could be an issue. Overall, if you go with an embedded web approach on Android, Chrome Custom Tabs are recommended for passkey flows, as they provide a good balance of integration and security. In fact, they are analogous to iOS's SFSafariViewController/ASWebAuthSession in many ways – leveraging the default browser for auth.
(Aside: Apple's WKWebView vs SFSafariViewController and Android's WebView vs CCT have many parallels. Both Safari VC and Chrome Tabs share browser state and provide better security, whereas WKWebView/Android WebView give more control but isolate the web content. For passkeys, sharing state (cookies, credential stores) is usually desirable so that the passkey can be accessed and created seamlessly.)
| Feature | WebView | Chrome Custom Tab |
|---|---|---|
| User experience | - Flexibility: Provides a rich set of APIs for interacting with web content and managing user interactions, including handling JavaScript dialogs and permission requests. - Consistency: Managing a consistent UX, especially with varied web content, can be challenging. | - Browser Features: Shares features like Data Saver and synchronized AutoComplete across devices. - Back Button: Allows users to easily return to the app with an integrated back button. - Dependency: Relies on Chrome app, which might not be available or updated on all user devices - Redirect to Browser: Certain functionalities might redirect users to the Chrome app, potentially disrupting the user experience. - Partial Custom Tabs: Only a portion of the screen can be used for the Chrome Custom Tab while the rest shows the native app - Side-sheet: In landscape mode and on large screen devices, the Chrome Custom Tab is only displayed on one side of the screen, while the rest of the screen shows the native app |
| Developer experience | - Highly Customizable: Offers extensive customization options/needs. - Interactivity: Provides numerous APIs for interacting with web content and managing user interactions. | - Customizable: Allows customization of toolbar color, action button, bottom toolbar, custom menu items, and in/out animations. - Callback: Delivers a callback to the application upon an external navigation. - Security Features: Provides out-of-the-box features, eliminating the need to manage requests, permission grants, or cookie stores. |
| Performance | - Mediocre Performance: May not offer the same level of performance Chrome Custom Tabs (CCT) | - Pre-Warming: Includes pre-warming of the Browser in the background and speculative loading of URLs to enhance page load time. - Priority: Prevents apps launching a Custom Tab from being evicted during its use by elevating its importance to the "foreground" level. |
| Trust and recognition | - URL & SSL not Visible: The URL and SSL information are not inherently visible in a WebView. Unless the app developer implements these features, users won't know if they're on the correct website or a phishing one. | - URL & SSL Visible: Uses the actual Chrome browser to render pages. Users can see the URL and SSL certificate (indicating if the connection is secure). This can provide users with confidence that they're not on a phishing site. |
| Isolation | - Runs within the App's Process: If an app has a vulnerability that allows malicious code execution, there's a risk that the WebView could be compromised. However, WebView also receives updates, but its behavior and security can be more dependent on the app using it. - No Cookie / Session Sharing: Doesn't share cookies or sessions with the device's main browser, offering isolation but possibly requiring users to log in again. | - Runs within Chrome's Process: Being part of Chrome, Custom Tabs run in the same process and have the same security updates and features as Chrome. - Shared Cookie Jar and Permissions Model: Ensures users don't have to re-sign into sites or re-grant permissions. - Chrome Settings & Preferences: Utilizes Chrome's settings and preferences. |
| Vulnerabilities | - Callbacks to Steal Credentials: Potential vulnerabilities include that sometimes JavaScript is required which opens the door for other apps to run malicious code, such as registering callbacks that try to intercept usernames and passwords. - Phishing: Additionally, a malicious app could open another web page that mimics the Link flow in a phishing attempt. | - Google Safe Browsing: Employs Google's Safe Browsing to shield both the user and device from hazardous sites. - Secure Browser Decoration: Ensures the user always sees the exact URL they are interacting with and can view the website's certificate information, reducing the risk of phishing. Furthermore, custom tabs do not allow JavaScript injection. |
| Other | - Google banned WebViews for login users into Google accounts |
Passkey behavior changes significantly on managed devices where Mobile Device Management (MDM) policies control credential storage. For a deep dive into testing passkeys on native apps and handling enterprise considerations, please refer to our dedicated articles:
The best path for implementing passkeys depends heavily on your app's existing authentication architecture. The primary question to ask is: Does my app use a native login screen or a WebView-based login? Answering this will guide your implementation choice.
If your app already features a native login experience, it is best practice to also implement passkeys natively. This ensures a consistent, seamless and fast user experience. Users expect a native feel, and adding passkeys via the platform's native APIs meets that expectation.
For a new native app or a native-first app, going 100% passwordless with a native implementation is the ideal goal. While you can use the raw platform APIs (Apple's AuthenticationServices, Android's Credential Manager), we strongly recommend using the Corbado SDKs to accelerate development:
Using an SDK can reduce integration time from months to weeks, abstracting WebAuthn complexity while leveraging official platform APIs to deliver a simple biometric login that delights users.
If your app currently uses a WebView to handle user authentication, you can leverage this existing infrastructure to introduce passkeys. The first step is to add WebAuthn support to your web-based login flow. Then, ensure your app loads this flow using the correct type of WebView to enable passkey access:
ASWebAuthenticationSession. It shares cookies and credentials with
Safari, allowing access to passkeys stored in the iCloud Keychain.Chrome Custom Tabs (CCT). It shares state with the user's Chrome
browser, enabling access to passkeys stored in the
Google Password Manager.This approach allows you to roll out passkeys quickly with minimal changes to your native app's code.
While your current architecture is the main driver, your long-term strategy might differ if you're building a new app versus updating an existing one.
For New Apps: We strongly recommend building a native login from day one and implementing passkeys natively. This sets you up for the best possible user experience and avoids a future migration from WebView to native.
For Existing Apps (especially with WebView login): A phased migration can be a pragmatic approach.
Key Requirements for a Hybrid or WebView Approach:
ASWebAuthenticationSession (iOS) and Chrome Custom Tabs (Android) to ensure the
WebView shares cookies and credentials with the system browser.AASA/assetlinks.json) correctly. This is
crucial for the native intercept in Phase 2.Finally, consider an opportunistic enrollment strategy. Some apps prompt users to create a passkey after they've successfully logged in with a traditional method like a password. For example, TikTok reportedly implemented a flow to "collect" a passkey post-authentication. If the user declines or their device doesn't support it, the app falls back silently. This allows you to gradually convert users to passkeys without a disruptive change to the login flow, making it a great strategy for existing applications.
Passkeys in native apps are used at scale in production. Deciding how to implement passkeys in your native app - via a pure native integration or an embedded WebView - is a crucial design choice that impacts security, user experience and development complexity. There is no one-size-fits-all answer.
If you can, go native sooner rather than later. A native passkey login offers the most seamless UX. With iOS and Android now providing first-class support for passkeys, and real-world successes demonstrating high adoption, the native approach is a proven best practice. The tooling (including open-source SDKs and platform libraries) has matured to make native integration achievable in reasonable time frames. And while you must be mindful of things like device management policies, cross-device sync, and third-party providers, these challenges can be managed with careful engineering and testing. The end result is an app login that delights users with its ease and speed, while significantly upping security.
On the other hand, if constraints require a WebView approach initially, that's perfectly valid. It enables you to support passkeys with minimal disruption, leveraging your existing web implementation. Just be sure to use the recommended WebView types (ASWebAuthenticationSession and Chrome Custom Tabs) to ensure compatibility with passkey autofill and security best practices.
Ultimately, passkeys in native apps represent a huge leap forward in both user convenience and security. Whether implemented via WebView or fully native, they eliminate phishing risks and password management burdens for your users. With careful planning (and the right partners or tools), you can offer passwordless, biometric logins in your app that truly realize the vision of passkeys: simple, safe and user-friendly authentication for everyone.
If passkeys aren't working in your native app, check these common issues:
Association File Issues:
application/json.well-known pathCredential Manager Errors:
Third-Party Provider Issues:
Origin Validation:
https://your-domain.com (not app://)For detailed debugging, see our article on Relying Party IDs in native apps.
Corbado Native SDKs:
Platform Documentation:
Validation Tools:
Passkeys Series: Native Apps
Related Articles
WebAuthn Relying Party ID (rpID) & Passkeys: Domains & Native Apps
Vincent - September 21, 2023
WebAuthn Resident Key: Discoverable Credentials as Passkeys
Vincent - September 28, 2023
Tutorial: How to Get Full Flutter Passkey Auth SDK in <1h
Lukas - September 5, 2023
Table of Contents