Classes
The following classes are available globally.
-
Main public interface for OATH functionality. This client handles TOTP and HOTP credential management and code generation.
The OathClient provides a high-level interface for managing OATH credentials, including adding credentials from URIs, generating OTP codes, and managing credential storage with policy enforcement.
Example usage:
See morelet client = try await OathClient.createClient { config in config.storage = OathKeychainStorage() config.enableCredentialCache = false config.logger = LogManager.logger } let credential = try await client.addCredentialFromUri("otpauth://totp/Example:user@example.com?secret=JBSWY3DPEHPK3PXP") let code = try await client.generateCode(credential.id)Declaration
Swift
public final class OathClient : @unchecked Sendable -
Configuration class specific for OATH MFA functionality. Extends the base configuration with OATH-specific settings.
Example usage:
See morelet config = OathConfiguration.build { config in config.storage = OathKeychainStorage() config.enableCredentialCache = false config.logger = customLogger }Declaration
Swift
public final class OathConfiguration : @unchecked Sendable -
Keychain-based storage implementation for OATH credentials. Uses iOS Keychain Services for secure credential storage.
This implementation stores credential metadata and secrets separately in the iOS Keychain. Credential metadata is stored as JSON data, while secrets are stored as secure keychain items with appropriate accessibility settings.
See moreNote
This class is thread-safe and handles concurrent access properly.Declaration
Swift
public final class OathKeychainStorage : OathStorage, @unchecked Sendable
View on GitHub
Classes Reference