iOS
Use this guide to open an IDMe OAuth 2.0 flow from an iOS app in the system browser. Read the native app integrations overview first.
Don’t load IDMe in a WKWebView. Use ASWebAuthenticationSession directly or through AppAuth for iOS. SFSafariViewController isn’t designed for sign-in flows and doesn’t return the redirect to your app, so use ASWebAuthenticationSession instead.
ASWebAuthenticationSession
ASWebAuthenticationSession opens IDMe in a secure Safari-based sheet, shares the member’s Safari session, and returns the redirect URL to your completion handler.
Universal link callback (iOS 17.4 and later)
Use an https redirect URI on a domain you own. Only your app can receive it.
The https callback requires the webcredentials associated domain for your redirect host:
- Add
webcredentials:example.comunder Signing & Capabilities > Associated Domains. - Publish an
apple-app-site-associationfile athttps://example.com/.well-known/apple-app-site-associationthat lists your app ID underwebcredentials.
Custom scheme callback
For apps that support earlier iOS versions, use a custom URL scheme such as com.example.app. Register the matching redirect URI, such as com.example.app:/idme/callback, with IDMe.
Handle the result
Leave prefersEphemeralWebBrowserSession set to false (the default) so returning members can reuse their existing IDMe sign-in. Set it to true only if your use case requires a fresh sign-in every time.
AppAuth for iOS
AppAuth wraps ASWebAuthenticationSession and adds PKCE and state handling.
Replace YOUR_SCOPE with your policy scope, and use the sandbox endpoints when testing.
Camera permissions
When IDMe runs in ASWebAuthenticationSession, Safari requests camera access for document, selfie, and liveness capture, including in-page capture by the IDMe Legal ID and face verification SDKs. Your app doesn’t need an NSCameraUsageDescription entry or a requestMediaCapturePermissionFor handler for IDMe capture steps. Don’t switch to a WKWebView for camera steps.
Testing checklist
- The authorization URL opens in
ASWebAuthenticationSession, not aWKWebVieworSFSafariViewController. - A member can sign in with a passkey.
- Document capture, selfie capture, and liveness checks complete on a physical device.
- Tapping Cancel returns the member to a recoverable screen.
- A redirect with a mismatched
stateis rejected. - For
httpscallbacks, theapple-app-site-associationfile is reachable and lists your app ID underwebcredentials.