PingFido
This module provides FIDO functionality for the Ping Orchestration SDK for iOS, utilizing native iOS APIs (AuthenticationServices) to support Passkeys and locally stored keys.
Getting Started
Prerequisites
- PingOne DaVinci or Ping Advanced Identity Cloud / PingAM Supported Versions
- iOS 16.0+
- Swift 6.0+
- Xcode 15+
Installation
To integrate the module into your iOS project, add the following dependency to your Package.swift or Podfile file.
Swift Package Manager
dependencies: [
.package(url: "https://github.com/ForgeRock/ping-ios-sdk.git", from: "<version>")
]
Then add the PingFido product to your target’s dependencies.
CocoaPods
pod 'PingFido', '~> <version>'
Import the Module
import PingFido
Overview
The FIDO module serves as a bridge between Ping Identity’s authentication flows (DaVinci and Journey) and Apple’s native FIDO capabilities through the AuthenticationServices framework. The Fido class acts as a proxy, abstracting the complexity of the underlying credential management system while providing a clean, consistent API for authentication operations.
Structure
The module is organized into the following structure:
- Fido/Fido: Contains the source code for the module.
Fido.swift: The main class that orchestrates the FIDO registration and authentication processes.FidoModels.swift: Contains the data models for FIDO requests and responses.FidoConstants.swift: Defines the constants used in the FIDO implementation.PingFido.h: The header file for the module.- Davinci: Contains the DaVinci collectors for FIDO operations.
AbstractFidoCollector.swift: A factory class for creating FIDO collectors.FidoRegistrationCollector.swift: Handles FIDO registration.FidoAuthenticationCollector.swift: Handles FIDO authentication.- Journey: Contains the Journey callbacks for FIDO operations.
FidoCallback.swift: Base class for FIDO callbacks.FidoRegistrationCallback.swift: Handles FIDO registration.FidoAuthenticationCallback.swift: Handles FIDO authentication.CallbackInitializer.swift: Registers the FIDO callbacks with the Journey framework.
Usage
DaVinci Integration
To use the FIDO module with DaVinci, you will need to handle the JSON payload from the server and use the appropriate collector.
- Get the JSON payload from the DaVinci server.
- Create the collector using the
AbstractFidoCollector.getCollector(with:)factory method. - Perform the FIDO operation by calling
register()orauthenticate()on the collector. - Send the payload back to the DaVinci server.
Example:
func handleDaVinciFido(json: [String: Any]) {
do {
let collector = try AbstractFidoCollector.getCollector(with: json)
if let registrationCollector = collector as? FidoRegistrationCollector {
registrationCollector.register(window: window) { result in
switch result {
case .success(let attestationValue):
// Send attestationValue to the server
break
case .failure(let error):
// Handle error
break
}
}
} else if let authenticationCollector = collector as? FidoAuthenticationCollector {
authenticationCollector.authenticate(window: window) { result in
switch result {
case .success(let assertionValue):
// Send assertionValue to the server
break
case .failure(let error):
// Handle error
break
}
}
}
} catch {
// Handle error
}
}
Journey Integration
To use the FIDO module with Journey, you need to register the FIDO callbacks and then handle them when they are received from the server.
- Register the callbacks at the start of your application.
- Handle the callbacks when they are received from the Journey server.
- Perform the FIDO operation by calling
register()orauthenticate()on the callback.
Example:
1. Register Callbacks:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
CallbackInitializer.registerCallbacks()
return true
}
2. Handle Callbacks:
import PingJourney
import PingFido
func handleJourneyNode(node: Node) {
if let callback = node.getCallback(FidoRegistrationCallback.self) {
callback.register(window: self.view.window!) { error in
if let error = error {
// Handle error
}
} else if let callback = node.getCallback(FidoAuthenticationCallback.self) {
callback.authenticate(window: self.view.window!) { error in
if let error = error {
// Handle error
}
}
}
}
}
License
This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.
© Copyright 2025-2026 Ping Identity Corporation. All Rights Reserved
View on GitHub