Interface OutOfBandPayloadDecode

All Superinterfaces:
Operation

public interface OutOfBandPayloadDecode extends Operation
The object that decodes an OutOfBandPayload from a String in JSON format or a base64 URL encoded String representing the JSON. The OutOfBandPayload can be used to trigger an out-of-band operation (see OutOfBandOperation).

Example:

  private void decodeOutOfBandPayload(Operations operations, String json) {
      operations.outOfBandPayloadDecode()
          .json(json)
          .onError(error -> {
              // handle error
          })
          .onSuccess(outOfBandPayload -> {
              // handle the OutOfBandPayload
          })
          .execute();
  }
 
The JSON is obtained from a push notification, or as a base 64 URL encoded JSON in QR codes generated by the server. JSON example:
 {
     "nma_data" : {
         "token" : "b4b07559-f934-4597-a1c5-44d89f691e8f",
         "redeem_url" : "https://fido.siven.ch/nevisfido/token/redeem/authentication",
         "attributeName" : "some additional data to be included in the QR code"
     },
     "nma_data_content_type" : "application/json",
     "nma_data_version" : "1"
 }
 
  • Method Details

    • json

      @NonNull OutOfBandPayloadDecode json(@NonNull String json)
      Specifies the JSON to be decoded.

      Either the plain JSON or the JSON as base 64 URL (see base64UrlEncoded(String)) must be provided.

      Parameters:
      json - the JSON
      Returns:
      a OutOfBandPayloadDecode
    • base64UrlEncoded

      @NonNull OutOfBandPayloadDecode base64UrlEncoded(@NonNull String base64UrlEncoded)
      Specifies the JSON as base 64 URL to be decoded

      Either the plain JSON (see json(String) or the JSON as base 64 URL must be provided.

      Parameters:
      base64UrlEncoded - the JSON encoded as a base 64 URL String
      Returns:
      a OutOfBandPayloadDecode
    • onError

      @NonNull OutOfBandPayloadDecode onError(@NonNull Consumer<OutOfBandPayloadError> errorConsumer)
      Specifies the object that will be invoked if the OutOfBandPayload could not be decoded. The specified object will receive an OutOfBandPayloadError. This object will be invoked in the main/UI thread.

      Providing the object handling the error is required.

      Parameters:
      errorConsumer - the consumer of an OutOfBandPayloadError
      Returns:
      an OutOfBandPayloadDecode
    • onSuccess

      @NonNull OutOfBandPayloadDecode onSuccess(@NonNull Consumer<OutOfBandPayload> outOfBandPayloadConsumer)
      Specifies the object that will be invoked if the OutOfBandPayload was decoded. This object will be invoked in the main/UI thread.

      Providing the object handling the success is required.

      Parameters:
      outOfBandPayloadConsumer - the consumer of an OutOfBandPayload
      Returns:
      an OutOfBandPayloadDecode