Generate Token for Web Integration

Required Class: Web API Class

Generating a Token for Web Integration

To use our web integration, you must generate a web token for every instance of the widget you run. You can generate a token with this library by editing the sample code below with your own information:

import smile.identity.core.WebApi;
import smile.identity.core.enums.Product;

// Initialize
String partnerId = "<Put your partner ID here>"; // login to the Smile ID portal to view your partner id
String defaultCallback = "<Put your default callback url here>";
String apiKey = "<Put your API key here>"; // copy your API key from the Smile ID portal
String sidServer = "<0 | 1>"; // Use '0' for the sandbox server, use '1' for production server

WebApi connection = new WebApi(partnerId, apiKey, defaultCallback, sidServer);


String userId = "<put your unique ID for the user here>";
String jobId = "<put your unique job ID here>";
Product product = Product.AUTHENTICATION // Product enum of product name  (AUTHENTICATION,BASIC_KYC, SMARTSELFIE, BIOMETRIC_KYC, ENHANCED_KYC, DOC_VERIFICATION, EKYC_SMART_SEFLIE, IDENTITY_VERIFICATION) 
String callbackUrl = "<Put your default callback url here>" // optional if callback url was set during initialization 
// Generate the web token 
String timestamp = Instant.now().toString();
String token = connection.getWebToken(timestamp, userId, jobId, product, callbackUrl);

// You can also call the method without passing in a callbackUrl 
String token = connection.getWebToken(timestamp, userId, jobId, product);

Last updated