Interface OutOfBandOperation
- All Superinterfaces:
HttpOperation<OutOfBandOperation>
,Operation
The operation managing an
OutOfBandPayload
. An OutOfBandPayload
can be provided through different means: a push notification, a QR code or an
application link. This operation will process the payload, decrypt it if needed
and send it to the server. If the payload is successfully handled by the server,
then the SDK will identify whether the operation associated with the payload is
a registration or an authentication; depending on that the authentication consumer
(see onAuthentication(Consumer)
) or the registration consumer
(see onRegistration(Consumer)
) will be invoked.
Usage example:
private void authenticateUsingOutOfBandPayload(Operations operations, OutOfBandPayload payload) { operations.outOfBandOperation() .payload(payload) .onRegistration(registration -> { // handle registration } .onAuthentication(authentication -> { // handle authentication } .onError(error -> { // handle out-of-band error }) .execute(); }
-
Method Summary
Modifier and TypeMethodDescriptiononAuthentication
(Consumer<OutOfBandAuthentication> authenticationConsumer) Specifies the object that will handle theOutOfBandAuthentication
object associated with theOutOfBandPayload
.onError
(Consumer<OutOfBandOperationError> errorConsumer) Specifies the object that will be invoked if there was an error handling theOutOfBandPayload
: the payload could not be decrypted, the server could not be reached, the server returned an error, etc.onRegistration
(Consumer<OutOfBandRegistration> registrationConsumer) Specifies the object that will handle theOutOfBandRegistration
object associated with the out-of-band payload.payload
(OutOfBandPayload payload) Specifies the out-of-band payload to be handled.Methods inherited from interface ch.nevis.mobile.sdk.api.operation.HttpOperation
requestHeaders
-
Method Details
-
payload
Specifies the out-of-band payload to be handled.Providing the out-of-band payload is required.
- Parameters:
payload
- the payload.- Returns:
- an
OutOfBandOperation
-
onRegistration
Specifies the object that will handle theOutOfBandRegistration
object associated with the out-of-band payload.Providing at least one of the
OutOfBandRegistration
orOutOfBandAuthentication
consumers is required.- Parameters:
registrationConsumer
- the registration consumer.- Returns:
- an
OutOfBandOperation
-
onAuthentication
Specifies the object that will handle theOutOfBandAuthentication
object associated with theOutOfBandPayload
.Providing at least one of the
OutOfBandRegistration
orOutOfBandAuthentication
consumers is required.- Parameters:
authenticationConsumer
- the authentication consumer.- Returns:
- an
OutOfBandOperation
-
onError
Specifies the object that will be invoked if there was an error handling theOutOfBandPayload
: the payload could not be decrypted, the server could not be reached, the server returned an error, etc. The specified object will receive anOutOfBandOperationError
. This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer
- the consumer of anOutOfBandOperationError
- Returns:
- an
OutOfBandOperation
-