OutOfBandAuthentication

public protocol OutOfBandAuthentication : HttpOperation

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

Usage example:

class AccountSelectorImpl: AccountSelector {
    func selectAccount(context: AccountSelectionContext, handler: AccountSelectionHandler) {
        handler.username(username)
    }
}

class AuthenticatorSelectorImpl: AuthenticatorSelector {
    func selectAuthenticator(context: AuthenticatorSelectionContext, handler: AuthenticatorSelectionHandler) {
        handler.aaid(aaid)
    }
}

class BiometricUserVerifierImpl: BiometricUserVerifier {
    func verifyBiometric(context: BiometricUserVerificationContext, handler: BiometricUserVerificationHandler) {
        handler.verify()
    }
}

class DevicePasscodeUserVerifierImpl: DevicePasscodeUserVerifier {
    func verifyDevicePasscode(context: DevicePasscodeUserVerificationContext, handler: DevicePasscodeUserVerificationHandler) {
        handler.verify()
    }
}

class PinUserVerifierImpl: PinUserVerifier {
    func verifyPin(context: PinUserVerificationContext, handler: PinUserVerificationHandler) {
        handler.verify(pin: pin)
    }
}

class PasswordUserVerifierImpl: PasswordUserVerifier {
    func verifyPassword(context: PasswordUserVerificationContext, handler: PasswordUserVerificationHandler) {
        handler.verify(password: password)
    }
}

client.operations.outOfBandOperation
    .payload(payload)
    .onRegistration { oobRegistration in
        ...
    }
    .onAuthentication { oobAuthentication in
        oobAuthentication
            .accountSelector(AccountSelectorImpl(...))
            .authenticatorSelector(AuthenticatorSelectorImpl(...))
            .biometricUserVerifier(BiometricUserVerifierImpl(...))
            .devicePasscodeUserVerifier(DevicePasscodeUserVerifierImpl(...))
            .pinUserVerifier(PinUserVerifierImpl(...))
            .passwordUserVerifier(PasswordUserVerifierImpl(...))
            .onError { error in
                ...
            }
            .onSuccess {
                ...
            }
            .execute()
    }
    .onError { error in
        ...
    }
    .execute()