How dashlane/apple-credential-provider-example works
This iOS demo lets a website register and authenticate passkeys through an enabled credential-provider extension. The extension handles registration confirmation and credential selection, then builds WebAuthn responses and returns them to iOS. Shared storage persists private keys and metadata and syncs credential identities for AutoFill; the host app lists and deletes passkeys. Registration and authentication orchestration are documented in the README, but the controller implementation was not sampled, so those links reflect documented behavior rather than inspected calls.
Main entry points: CredentialProviderViewController.swift Provider controller · PasskeyStore.swift Passkey store · AuthenticatorData.swift Authenticator data · ContentView.swift Passkey list
Components 18
Host app
- Demo app
PasskeyProviderDemo/PasskeyProviderDemoApp.swift - Passkey list
PasskeyProviderDemo/ContentView.swift - Setup guide
PasskeyProviderDemo/SetupInstructionsView.swift
Credential extension
- Provider controller
PasskeyProviderExtension/CredentialProviderViewController.swift - Registration confirmation
PasskeyProviderExtension/Views/RegistrationConfirmView.swift - Credential chooser
PasskeyProviderExtension/Views/CredentialListView.swift
WebAuthn encoding
- Authenticator data
Shared/Sources/Shared/WebAuthn/AuthenticatorData.swift - COSE key encoding
Shared/Sources/Shared/WebAuthn/COSEKey.swift - Attestation builder
Shared/Sources/Shared/WebAuthn/AttestationBuilder.swift - Assertion builder
Shared/Sources/Shared/WebAuthn/AssertionBuilder.swift
Credential storage
- Passkey metadata
Shared/Sources/Shared/Models/StoredPasskey.swift - Passkey store
Shared/Sources/Shared/Storage/PasskeyStore.swift - Keychain
- App Group metadata
- Identity store manager
Shared/Sources/Shared/Storage/CredentialIdentityStoreManager.swift
Other components
- Website
- iOS credential system
- iOS identity store
Connections 23
- Website → iOS credential system: requests credentials
- iOS credential system → Provider controller: dispatches request
- Provider controller → Registration confirmation: presents registration
- Provider controller → Credential chooser: presents credentials
- Registration confirmation → Provider controller: confirms creation
- Credential chooser → Provider controller: selects credential
- Provider controller → Passkey store: saves or retrieves
- Provider controller → Authenticator data: builds authenticator data
- Provider controller → Attestation builder: builds attestation
- Provider controller → Assertion builder: builds assertion
- Attestation builder → Authenticator data: encodes data
- Assertion builder → Authenticator data: encodes data
- Authenticator data → COSE key encoding: encodes public key
- Provider controller → iOS credential system: returns credential
- Demo app → Passkey list: shows home
- Passkey list → Passkey store: lists or deletes
- Passkey list → Setup guide: opens guide
- Passkey store → Passkey metadata: stores metadata
- Passkey store → Keychain: writes private key
- Passkey store → App Group metadata: reads and writes
- Passkey store → Identity store manager: syncs identities
- Identity store manager → iOS identity store: updates identities
- Website → iOS credential system: receives response