FIDO U2F Sign Operation - iOS Example

 Below is the code related to processing a FIDO U2F sign operation.



SurePassIdU2F *u2f; U2FClientSettings *settings = [[U2FClientSettings alloc] initWithNavigationController:self.navigationController fidoEndpointURL:serverUrl]; u2f = [[SurePassIdU2F alloc] initWithSettings:settings]; [u2f registerUsername:self->_username securityKeyName:alert.textFields.firstObject.text fidoRegisterResultHandler:^(enum U2FResult result) { switch (result) { case SUCCESS: // FIDO Registration succeeded. break; case CANCELED: // The user canceled FIDO Registration. break; case FALLBACK_AUTHENTICATION: // IGNORED! Not applicable to registration. break; } } fidoClientErrorHandler:^(NSString * _Nullable errorMessage) { // Handle FIDO Client errors. } fidoServerErrorHandler:^(NSString * _Nullable errorMessage, int errorCode) { // Handle FIDO Server errors. }];