Authentication
Models and methods for managing device authentication mechanisms (PIN and biometrics).
TFAuthenticationMechanism
Represents a supported authentication mechanism.
- iOS (Swift)
- Android (Java)
public enum TFAuthenticationMechanism: String, Codable {
case pin
case biometrics
}
public enum TFAuthenticationMechanism {
PIN,
BIOMETRIC
}
TFAuthentication
Authentication credential passed to addAuthentication in an operation decision flow. Mirrors the iOS Authentication enum with associated values.
- iOS (Swift)
- Android (Java)
public enum Authentication {
case biometric(context: LAContext)
case pin(value: String)
}
// Biometric — cipher must be the authenticated Cipher from BiometricPrompt.CryptoObject
TFAuthentication.biometric(Cipher cipher)
// PIN
TFAuthentication.pin(String value)
TFAuthenticationResponse
Returned upon a successful authentication. The refreshToken can be stored to restore session without re-authenticating with a PIN.
- iOS (Swift)
- Android (Java)
public struct TFAuthenticationResponse {
public let refreshToken: String
public init(refreshToken: String)
}
public class TFAuthenticationResponse {
public String refreshToken;
}
TFAuthenticationPINRequirements
Defines the allowed PIN length range and validates a PIN against it.
- iOS (Swift)
- Android (Java)
public struct TFAuthenticationPINRequirements: Codable {
public let minLength: Int
public let maxLength: Int
/// Returns an error if the PIN does not satisfy the requirements, otherwise nil.
public func validate(pin: String) -> Error?
public init(minLength: Int, maxLength: Int)
}
public class TFAuthenticationPINRequirements {
public TFAuthenticationPINRequirements(int minLength, int maxLength)
public int getMinLenght()
public int getMaxLenght()
/** Returns an error if the PIN does not satisfy the requirements, otherwise null. */
public Error validate(String pin)
}