Interface OutOfBandAuthentication
- All Superinterfaces:
HttpOperation<OutOfBandAuthentication>,Operation
OutOfBandPayload was processed and the OutOfBandPayload
corresponds to an authentication operation.
Example:
private void authenticateUsingOutOfBandPayload(Operations operations, OutOfBandPayload payload) {
operations.outOfBandOperation()
.payload(payload)
.onAuthentication(authentication ->
authentication.authenticatorSelector((ctx, consumer) -> {
// select authenticator
})
.pinUserVerifier(pinUserVerifier)
.fingerprintUserVerifier(fingerprintUserVerifier)
.biometricUserVerifier(biometricUserVerifier)
.onError(error -> {
// handle error
})
.onSuccess(() -> {
// handle success
})
.execute())
.onRegistration(registration -> {
// handle registration
})
.onError(error -> {
// handle out-of-band error
})
.execute();
}
-
Method Summary
Modifier and TypeMethodDescriptionaccountSelector(AccountSelector selector) Specifies theAccountSelectorto be used during the out-of-band authentication.authenticatorSelector(AuthenticatorSelector selector) Specifies the object that will take care of the selection of the authenticator to be used.biometricUserVerifier(BiometricUserVerifier userVerifier) Specifies the object that will take care of the biometric user verification.devicePasscodeUserVerifier(DevicePasscodeUserVerifier userVerifier) Specifies the object that will take care of the device passcode user verification.voidexecute()Executes the out-of-band authentication.fingerprintUserVerifier(FingerprintUserVerifier userVerifier) Specifies the object that will take care of the fingerprint user verification.onError(Consumer<OperationError> errorConsumer) Specifies the object that will be invoked if the authentication failed.onSuccess(Consumer<AuthorizationProvider> onSuccess) Specifies the object that will be invoked if the authentication was successful.passwordUserVerifier(PasswordUserVerifier userVerifier) Specifies the object that will take care of the password user verification.pinUserVerifier(PinUserVerifier userVerifier) Specifies the object that will take care of the PIN user verification.Methods inherited from interface ch.nevis.mobile.sdk.api.operation.HttpOperation
requestHeaders
-
Method Details
-
accountSelector
Specifies theAccountSelectorto be used during the out-of-band authentication. Specifying this is only required when username-less authentication and multiple accounts must be supported.- Parameters:
selector- theAccountSelector- Returns:
- an
OutOfBandAuthentication
-
authenticatorSelector
Specifies the object that will take care of the selection of the authenticator to be used.Providing the authenticator selector is required.
- Parameters:
selector- theAuthenticatorSelector- Returns:
- an
OutOfBandAuthentication
-
pinUserVerifier
Specifies the object that will take care of the PIN user verification.Providing at least one of the
BiometricUserVerifier,PinUserVerifier,PasswordUserVerifier,DevicePasscodeUserVerifierorFingerprintUserVerifieris required.- Parameters:
userVerifier- thePinUserVerifier- Returns:
- an
OutOfBandAuthentication
-
passwordUserVerifier
Specifies the object that will take care of the password user verification.Providing at least one of the
BiometricUserVerifier,PinUserVerifier,PasswordUserVerifier,DevicePasscodeUserVerifierorFingerprintUserVerifieris required.- Parameters:
userVerifier- thePasswordUserVerifier- Returns:
- an
OutOfBandAuthentication
-
fingerprintUserVerifier
@NonNull OutOfBandAuthentication fingerprintUserVerifier(@NonNull FingerprintUserVerifier userVerifier) Specifies the object that will take care of the fingerprint user verification.Providing at least one of the
BiometricUserVerifier,PinUserVerifier,PasswordUserVerifier,DevicePasscodeUserVerifierorFingerprintUserVerifieris required.- Parameters:
userVerifier- theFingerprintUserVerifier- Returns:
- an
OutOfBandAuthentication
-
biometricUserVerifier
Specifies the object that will take care of the biometric user verification.Providing at least one of the
BiometricUserVerifier,PinUserVerifier,PasswordUserVerifier,DevicePasscodeUserVerifierorFingerprintUserVerifieris required.- Parameters:
userVerifier- theBiometricUserVerifier- Returns:
- an
OutOfBandAuthentication
-
devicePasscodeUserVerifier
@NonNull OutOfBandAuthentication devicePasscodeUserVerifier(@NonNull DevicePasscodeUserVerifier userVerifier) Specifies the object that will take care of the device passcode user verification.Providing at least one of the
BiometricUserVerifier,PinUserVerifier,PasswordUserVerifier,DevicePasscodeUserVerifierorFingerprintUserVerifieris required.- Parameters:
userVerifier- theDevicePasscodeUserVerifier- Returns:
- a
OutOfBandAuthentication
-
onSuccess
Specifies the object that will be invoked if the authentication was successful. The specified object will receive anAuthorizationProvider. This object will be invoked in the main/UI thread.Providing the object handling the success is required.
- Parameters:
onSuccess- the consumer of anAuthorizationProvider- Returns:
- an
Authentication
-
onError
Specifies the object that will be invoked if the authentication failed. The specified object will receive anOperationError. This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer- the consumer of anOperationError- Returns:
- an
OutOfBandAuthentication
-
execute
void execute()Executes the out-of-band authentication. Note that in the case of out-of-band authentication, this method can only be invoked once. When invoked more than once, anIllegalStateExceptionwill be thrown.
-