Interface OutOfBandOperation

All Superinterfaces:
HttpOperation<OutOfBandOperation>, Operation

public interface OutOfBandOperation extends HttpOperation<OutOfBandOperation>
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 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

      OutOfBandOperation onRegistration(Consumer<OutOfBandRegistration> registrationConsumer)
      Specifies the object that will handle the OutOfBandRegistration object associated with the out-of-band payload.

      Providing at least one of the OutOfBandRegistration or OutOfBandAuthentication consumers is required.

      Parameters:
      registrationConsumer - the registration consumer.
      Returns:
      an OutOfBandOperation
    • onAuthentication

      OutOfBandOperation onAuthentication(Consumer<OutOfBandAuthentication> authenticationConsumer)
      Specifies the object that will handle the OutOfBandAuthentication object associated with the OutOfBandPayload.

      Providing at least one of the OutOfBandRegistration or OutOfBandAuthentication 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 the OutOfBandPayload: the payload could not be decrypted, the server could not be reached, the server returned an error, etc. The specified object will receive an OutOfBandOperationError. This object will be invoked in the main/UI thread.

      Providing the object handling the error is required.

      Parameters:
      errorConsumer - the consumer of an OutOfBandOperationError
      Returns:
      an OutOfBandOperation