Authentication

public protocol Authentication : HttpOperation

The object that can be used to trigger an authentication operation.

Usage example:

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.authentication
    .username(username)
    .authenticatorSelector(AuthenticatorSelectorImpl(...))
    .biometricUserVerifier(BiometricUserVerifierImpl(...))
    .devicePasscodeUserVerifier(DevicePasscodeUserVerifierImpl(...))
    .pinUserVerifier(PinUserVerifierImpl(...))
    .passwordUserVerifier(PasswordUserVerifierImpl(...))
    .onError { error in
        ...
    }
    .onSuccess { authorizationProvider in
        ...
    }
    .execute()