iOS: Introduction
The iOS SDK provides a comprehensive solution for integrating Liquid Auth into iOS applications and Autofill Credential Extensions. It enables self-sovereign FIDO2/WebAuthn authentication with deterministically generated P256 passkeys and facilitates decentralized peer-to-peer communication between dApps and wallets.
Features
- Self-Sovereign Passkeys: Allows wallet developers to manage passkeys themselves (e.g. using deterministically generated P256 passkeys) instead of relying on centralized password managers.
- WebRTC P2P Communication: Direct, authenticated communication between dApps and wallets, over WebRTC data channels.
- Sign-In with Algorand: Extends FIDO2/WebAuthn with Ed25519 Algorand address signatures, to prove ownership of address.
- Dual Mode Operation:
liquid://
URIs/QR Codes for authenticated peer-to-peer communicationsFIDO:/
URIs/QR Codes for standard Web2 site authentication via Autofill Credential Extensions
Prerequisites
- iOS 17+ is required
- Physical device for WebRTC testing (simulators don’t support WebRTC)
- Xcode 15+
- Swift Package Manager or Xcode package integration
Installation
Swift Package Manager
Add this to your Package.swift
:
dependencies: [ .package(url: "https://github.com/algorandfoundation/liquid-auth-ios.git", from: "0.0.1")]
Xcode Integration
- File → Add Package Dependencies…
- Enter:
https://github.com/algorandfoundation/liquid-auth-ios.git
- Select version and add to your target
Modes of Operation
1. Liquid Auth Mode (liquid://
)
Paired with the Liquid Auth Backend for authenticated peer-to-peer communications:
┌─────────────┐ WebRTC ┌─────────────┐│ dApp │◄──────────────►│ Wallet ││ (Offerer) │ │ (Answerer) │└─────────────┘ └─────────────┘ │ │ └─────── Liquid Auth Backend ───┘
Use Cases:
- LiquidAuth.com demo
- use-wallet integrations
- dApp-to-wallet transaction signing
2. Autofill Credential Extension (FIDO:/
)
Integration with iOS native passkey management for standard Web2 authentication:
Use Cases:
- webauthn.io, webauthn.me
- passkeys.com
- GitHub and other passkey-enabled sites
Quick Start
Integration Points
The SDK provides WebAuthn infrastructure, but you’ll need to integrate with your wallet for:
- Challenge Signing: Sign WebAuthn challenges with your Algorand Ed25519 private key
- Message Handling: Process incoming WebRTC messages (e.g. transaction signing requests)
- Key Management: Manage P256 and Algorand key pairs, or their mnemonics, securely
Next Steps
- Registration: Learn how to register passkeys with the service
- Authentication: Understand the authentication flow
- Peer Communication: Set up WebRTC signaling
- Autofill Extension: Integrate with iOS native passkey management
Example Implementation
For a complete reference implementation, see the liquid-auth-ios-example repository, which demonstrates both main app integration and Autofill Credential Extension usage.