Last modified: 2024-11-01

Sample Integration Code

The sample Java code discussed in this section illustrates how to use the Integration SDK to integrate the OneSpan Sign Application Backend with an External Verification Server.

Specifically, this section discusses:

Adding the SDK to Your Project

To add the Integration SDK to your project as a dependency you must download the Integration SDK. To download the Integration SDK, click here.

Sample Java Files

The following four files of sample Java code illustrate how to use various aspects of the Integration SDK:

  1. VerificationRequestTokenConversion.java
  2. VerificationResponseTokenGeneration.java
  3. VerificationRequestTokenGeneration.java
  4. VerificationResponseTokenConversion.java

Files 1 and 2 contain code for the External Verification Server. Files 3 and 4 contain code for the OneSpan Sign Application Backend.

File 1: External Verification Server

File 1 (VerificationRequestTokenConversion.java) illustrates how the External Verification Server converts an extracted Signer Verification Request Token into a SignerVerificationRequest object by calling the method SignerVerificationProcessor.toSignerVerificationRequest().

File 2: External Verification Server

File 2 (VerificationResponseTokenGeneration.java) illustrates how the External Verification Server generates a Signer Verification Response Token.

It first retrieves the saved SignerVerificationRequest object, and then pulls the Document Identification Information as well as the Callback URL from it.

It subsequently constructs a SignerVerificationResponse object with the Document Identification Information as the value of one of its fields.

The SignerVerificationResponse object is then converted to a Signer Verification Response Token by calling the method SignerVerificationProcessor.toSignerVerificationResponsePayload().

Finally, the result, along with the Callback URL, is used to build a redirect URL to send the user back to the Signer Experience.

File 3: OneSpan Sign Application Backend

File 3 (VerificationRequestTokenGeneration.java) illustrates how the OneSpan Sign Application Backend constructs a SignerVerificationRequest, which is then converted to a Signer Verification Request Token by calling the method SignerVerificationProcessor.toSignerVerificationRequestPayload().

The result is subsequently used to build a redirect URL to send the signer to the website of the External Verification Provider.

File 4: OneSpan Sign Application Backend

File 4 (VerificationResponseTokenConversion.java) illustrates how the OneSpan Sign Application Backend converts an extracted Signer Verification Response Token to a SignerVerificationResponse object by calling the method SignerVerificationProcessor.toSignerVerificationResponse().

Was this information helpful?
X