TGFPasscodeAuthenticatorDelegate
Objective-C
@protocol TGFPasscodeAuthenticatorDelegate <NSObject>
Swift
protocol TGFPasscodeAuthenticatorDelegate : NSObjectProtocol
A delegate protocol that an application must implement to handle UI interactions for the Passcode Authenticator.
The FIDO2 SDK relies on the conforming delegate to display the secure keyboard and to inform the user about the status of passcode operations (enrollment, authentication, etc.).
Note
All callbacks are invoked on the Main thread.@since 1.0.0
-
Called when the SDK requires the application to display the secure keyboard for user input.
Declaration
Objective-C
- (void)passcodeAuthenticator: (TGFPasscodeAuthenticator *_Nullable)passcodeAuthenticator willStartWithKeyboard:(id<TGFKeyboard> _Nonnull)keyboard operationInfo:(TGFFido2OperationInfo *_Nullable)operationInfo cancelHandler:(void (^_Nonnull)(void))cancelHandler failureHandler: (void (^_Nonnull)(NSString *_Nullable))failureHandler;Swift
optional func passcodeAuthenticator(_ passcodeAuthenticator: TGFPasscodeAuthenticator?, willStartWith keyboard: any TGFKeyboard, operationInfo: TGFFido2OperationInfo?, cancelHandler: @escaping () -> Void, failureHandler: @escaping (String?) -> Void)Parameters
passcodeAuthenticatorTGFPasscodeAuthenticator object.
keyboardAn object conforming to the TGFKeyboard protocol to present a secure keyboard for passcode entry.
operationInfoAn object containing information about the current FIDO2 operation.
cancelHandlerA block that your application must call if the user cancels the operation.
failureHandlerA block to be called if an unexpected error prevents the keyboard flow from starting.
-
-passcodeAuthenticator:setPasscodeForInfo: isChangePasscode: passcodeHandler: cancelHandler: failureHandler: Provides a passcode programmatically, bypassing the secure keyboard UI.
This is an optional method for advanced use cases where the application collects the passcode through its own UI and provides it directly to the SDK.
Note
If this method is implemented, the
passcodeAuthenticator:requestsKeyboard:forOperation:cancelHandler:failureHandler:method will not be called.@since 1.8.0
Declaration
Objective-C
- (void)passcodeAuthenticator: (TGFPasscodeAuthenticator *_Nullable)passcodeAuthenticator setPasscodeForInfo:(TGFFido2OperationInfo *_Nullable)operationInfo isChangePasscode:(BOOL)isChangePasscode passcodeHandler: (nonnull void (^)(NSData *_Nonnull, NSData *_Nullable))passcodeHandler cancelHandler:(void (^_Nonnull)(void))cancelHandler failureHandler:(void (^_Nonnull)(void))failureHandler;Swift
optional func passcodeAuthenticator(_ passcodeAuthenticator: TGFPasscodeAuthenticator?, setPasscodeFor operationInfo: TGFFido2OperationInfo?, isChangePasscode: Bool, passcodeHandler: @escaping (Data, Data?) -> Void, cancelHandler: @escaping () -> Void, failureHandler: @escaping () -> Void)Parameters
passcodeAuthenticatorTGFPasscodeAuthenticator object.
operationInfoAn object containing information about the current FIDO2 operation.
isChangePasscodeYESif this is part of a change passcode flow,NOotherwise.passcodeHandlerA block your application must call to provide the passcode(s).
- For enrollment or authentication: provide the passcode in the
passcodeparameter andnilforupdatedPasscode. - For changing a passcode: provide the old passcode in
passcodeand the new passcode inupdatedPasscode.
cancelHandlerA block to be called if the user cancels the operation.
failureHandlerA block to be called if the SDK cannot proceed with the programmatic flow, indicating that the standard keyboard flow should be used instead.
- For enrollment or authentication: provide the passcode in the
-
Called when a passcode-related operation (enrollment, unenrollment, or change passcode) completes successfully.
Note
This callback is NOT invoked during FIDO2 Registration/Authentication operations.
Declaration
Objective-C
- (void)passcodeAuthenticatorDidFinish: (TGFPasscodeAuthenticator *_Nonnull)passcodeAuthenticator;Swift
optional func passcodeAuthenticatorDidFinish(_ passcodeAuthenticator: TGFPasscodeAuthenticator)Parameters
passcodeAuthenticatorTGFPasscodeAuthenticator object
-
Called when any passcode-related operation fails.
Note
This callback is NOT invoked during FIDO2 Registration/Authentication operations.
Declaration
Objective-C
- (void)passcodeAuthenticator: (TGFPasscodeAuthenticator *_Nonnull)passcodeAuthenticator didFailWithError:(nonnull NSError *)error;Swift
optional func passcodeAuthenticator(_ passcodeAuthenticator: TGFPasscodeAuthenticator, didFailWithError error: any Error)Parameters
passcodeAuthenticatorTGFPasscodeAuthenticator object
errorAn error object.