NMAOutOfBandAuthentication

@objc
public protocol NMAOutOfBandAuthentication : NMAHttpOperation

The operation handling an out-of-band authentication. This is the object returned by the SDK, when an NMAOutOfBandPayload was processed and the NMAOutOfBandPayload corresponds to an authentication operation.

Usage example:

@interface NMAAccountSelectorImpl: NSObject <NMAAccountSelector>

@end

@implementation NMAAccountSelectorImpl

- (void)selectAccountWithContext:(id<NMAAccountSelectionContext> _Nonnull)context handler:(id<NMAAccountSelectionHandler> _Nonnull)handler {
    [handler username:username];
}

@end

@interface NMAAuthenticatorSelectorImpl : NSObject <NMAAuthenticatorSelector>

@end

@implementation NMAAuthenticatorSelectorImpl

- (void)selectAuthenticatorWithContext:(id<NMAAuthenticatorSelectionContext> _Nonnull)context handler:(id<NMAAuthenticatorSelectionHandler> _Nonnull)handler {
    [handler aaid:aaid];
}

@end

@interface NMABiometricUserVerifierImpl : NSObject <NMABiometricUserVerifier>

@end

@implementation NMABiometricUserVerifierImpl

- (void)verifyBiometricWithContext:(id<NMABiometricUserVerificationContext> _Nonnull)context handler:(id<NMABiometricUserVerificationHandler> _Nonnull)handler {
    [handler verify];
}

@end

@interface NMADevicePasscodeUserVerifierImpl : NSObject <NMADevicePasscodeUserVerifier>

@end

@implementation NMADevicePasscodeUserVerifierImpl

- (void)verifyDevicePasscodeWithContext:(id<NMADevicePasscodeUserVerificationContext> _Nonnull)context handler:(id<NMADevicePasscodeUserVerificationHandler> _Nonnull)handler {
    [handler verify];
}

@end

@interface NMAPinUserVerifierImpl : NSObject<NMAPinUserVerifier>

@end

@implementation NMAPinUserVerifierImpl

- (void)verifyPinWithContext:(id<NMAPinUserVerificationContext> _Nonnull)context handler:(id<NMAPinUserVerificationHandler> _Nonnull)handler {
    [handler verify:pin];
}

@end

id<NMAOutOfBandOperation> oobOperation = [[client operations] outOfBandOperation];

[oobOperation payload:payload];
[oobOperation onRegistration:^(id<NMAOutOfBandRegistration> _Nonnull registration) {...}];

[oobOperation onAuthentication:^(id<NMAOutOfBandAuthentication> _Nonnull authentication) {
    [authentication accountSelector:[[NMAAccountSelectorImpl alloc] init]];
    [authentication authenticatorSelector:[[NMAAuthenticatorSelectorImpl alloc] init]];
    [authentication pinUserVerifier:[[NMAPinUserVerifierImpl alloc] init]];
    [authentication biometricUserVerifier:[[NMABiometricUserVerifierImpl alloc] init]];
    [authentication devicePasscodeUserVerifier:[[NMADevicePasscodeUserVerifierImpl alloc] init]];
    [authentication onSuccess:^(id<NMAAuthorizationProvider> _Nullable authorizationProvider) {...}];
    [authentication onError:^(NMAOperationError * _Nonnull error) {...}];
    [authentication execute];
}];

[oobOperation onError:^(NMAOutOfBandOperationError * _Nonnull error) {...}];
[oobOperation execute];