Enumerations

The following enumerations are available globally.

  • Enum representing the different push notification platforms supported by the SDK.

    Each platform has its own specific implementation for handling push notifications, including message parsing, registration, and response sending. The platform determines which PushHandler implementation will be used to process notifications.

    Extensibility

    While the SDK currently supports PingAM as the primary platform, the architecture is designed to support additional platforms in the future. Custom platform implementations can be added by implementing the PushHandler protocol and registering them with the PushConfiguration.

    Standards Compliance

    • PingAM: Implements the Ping Identity Access Management push authentication protocol
    See more

    Declaration

    Swift

    public enum PushPlatform : String, CaseIterable, Codable, Sendable
  • Enum representing the different types of Push notifications.

    Push notifications can be of different types depending on the authentication requirements:

    • DEFAULT: Standard push notification requiring simple approval/denial
    • CHALLENGE: Push notification requiring a challenge response (e.g., number matching)
    • BIOMETRIC: Push notification requiring biometric authentication

    Use Cases

    • DEFAULT: Used for basic push authentication where the user simply approves or denies the request
    • CHALLENGE: Used when additional verification is needed, such as number matching to prevent push bombing
    • BIOMETRIC: Used when biometric verification (Touch ID, Face ID) is required for authentication

    Standards Compliance

    These types align with the push authentication mechanisms supported by PingAM and other identity management platforms.

    See more

    Declaration

    Swift

    public enum PushType : String, CaseIterable, Codable, Sendable
  • Errors that can occur during Push operations.

    PushError provides comprehensive error handling for all Push-related operations, including credential management, URI parsing, notification processing, and policy enforcement. Each error case includes detailed information to help developers diagnose and resolve issues.

    Error Categories

    • Initialization: Errors during client initialization
    • Credential Management: Errors related to storing, retrieving, and managing credentials
    • URI Parsing: Errors that occur when parsing pushauth:// or mfauth:// URIs
    • Notification Processing: Errors during push notification handling
    • Policy: Errors related to policy enforcement and credential locking
    • Network: Errors during communication with the server
    • Storage: Errors related to persistent storage operations

    Usage Examples

    do {
        let credential = try await client.addCredentialFromUri(uri)
        let notification = try await client.processNotification(userInfo)
    } catch let error as PushError {
        switch error {
        case .invalidUri(let message):
            print("Invalid URI format: \(message)")
            // Show user-friendly error about QR code format
        case .credentialLocked(let id):
            print("Credential is locked: \(id)")
            // Prompt user for authentication or wait for unlock
        case .networkFailure(let message, _):
            print("Network error: \(message)")
            // Retry or show offline message
        default:
            print("Push error: \(error.localizedDescription)")
        }
    }
    
    See more

    Declaration

    Swift

    public enum PushError : Error, LocalizedError, Sendable
  • Errors specific to Push storage operations.

    These errors are thrown by storage implementations when persistence operations fail.

    See more

    Declaration

    Swift

    public enum PushStorageError : Error, LocalizedError, Sendable
  • Utility class for parsing and formatting Push URIs. Supports both pushauth:// and mfauth:// schemes.

    This parser handles the standard Push URI format used for credential registration via QR codes and supports additional parameters for enhanced functionality.

    URI Format

    pushauth://push/issuer:accountName?r=regEndpoint&a=authEndpoint&s=sharedSecret&d=userId
    mfauth://push/issuer:accountName?r=regEndpoint&a=authEndpoint&s=sharedSecret&d=userId
    

    Required Parameters

    • r: Registration endpoint (base64-encoded)
    • a: Authentication endpoint (base64-encoded)
    • s: Shared secret for signing (base64url-encoded)

    Optional Parameters

    • d: User ID (base64-encoded)
    • pid: Push resource ID (base64-encoded)
    • issuer: Issuer name (base64-encoded if from pushauth, plain if from mfauth)
    • image: Image URL (base64-encoded)
    • b: Background color (hex without #)
    • policies: Authenticator policies (base64-encoded JSON)
    • c: Challenge parameter for registration
    • l: Load balancer cookie for registration
    • m: Message ID for registration
    See more

    Declaration

    Swift

    public enum PushUriParser