Apple announced at the WWDC21 session 10106: Move Beyond Passwords that WebAuthn credentials will be available as “Passkeys” in the iCloud Keychain, as well as the availability of system-wide WebAuthn APIs on iOS 15, iPadOS 15, and macOS 12 Monterey.
In their video, Apple demonstrates the creation and seamless synchronization of Passkeys across devices using Safari. On top of that they even show that WebAuthn works with native iOS apps using the same Passkeys.
This app authenticates its users with Passkeys (aka WebAuthn credentials) that will be shared with a web app. It requires the Apple Passkey Demo webapp as its backend! We have an article describing the setup and explaining the code on our blog.
To be able to run this app you need the Apple Passkey Demo webapp up and running on an SSL capable host. Please set it up first before you continue!
To build and run this app on your device:
- Open the sample with Xcode 13 or later.
- Select the Shiny project.
- For the project's target, choose your team from the Team drop-down menu in the Signing & Capabilities pane to let Xcode automatically manage your provisioning profile.
- Add the Associated Domains capability, and specify your domain with the
webcredentials
service. - Ensure an
apple-app-site-association
(AASA) file is present on your domain, in the.well-known
directory, and it contains an entry for this app's App ID for thewebcredentials
service. - In the
AccountManager.swift
file, replaceyourdomain.here
with the name of your domain. - Turn on the Syncing Platform Authenticator setting on your iOS device in Settings > Developer. If you're running the Catalyst app on macOS, select Enable Syncing Platform Authenticator in Safari's Developer menu.