This is a reference application to demonstrate how ID Verification API can be used.
This reference app consist of the
ID Verificationsolution.
- The OpenAPI specification for
idverifyendpoints can be found here.
- Mastercard Developers Account with access to ID Verification API.
- A text editor or any other IDE of your choice.
- Java 8.
- Apache Maven 3.3+.
- Set up the
JAVA_HOMEenvironment variable to match the location of your Java installation. - Set up the
MAVEN_HOMEenvironment variable to match the location of your maven installation (necessary when running from terminal / command line). - A valid phone number that can retrieve the OTP code is required for the menu item [4 - SMS OTP].
This
README.mdis inside the project, if necessary download and unzip the project Mastercard ID Verification Reference through this link Reference Application.
-
Create an account or log in at Mastercard Developers.
-
Create a new project and add
ID VerificationAPI to your project. -
Configure the project and download all the keys. It will download multiple files (in case of zip files extract all).
-
Download
.pemfile from theClient Encryption Keyssection, open theactionscombobox and clickdownload encryption. -
Select all
.p12files,.pemfile and copy it tosrc/main/resourcesin the project folder. -
Open
${project.basedir}/src/main/resources/application.propertiesand configure below parameters.Connection
mastercard.api.idVerify.key.file=classpath:<your value>, this refers to.p12file found in the signing key. For exampleMastercard_ID_Assist_Develop-sandbox.p12.Authentication
mastercard.api.idVerify.consumer.key=, this refers to your consumer key. Copy it from the "Keys" section on your project page.mastercard.api.idVerify.keystore.alias=keyalias, this is the default value of key alias. If it is modified, use the updated one from the keys section on your project page.mastercard.api.keystore.password=keystorepassword, this is the default value of the keystore password.Encryption
mastercard.api.idVerify.encryption.certificateFile=classpath:<your value>, this is the path to certificate (.pem) file. For examplemastercard-id-assistClientEnc1593629971.pemmastercard.api.idVerify.encryption.fingerPrint=, this is fingerprint of encryption key, it is required to encrypt a request. For example350f0b0268db2ab5b9c105aae77748d99850b773195f378527500c6269a59112.Decryption
mastercard.api.idVerify.decryption.keystore=classpath:<your value>, this refers to.p12file in Mastercard Encryption Keys. For exampleclasspath:alias-encryption-mc.p12mastercard.api.idVerify.decryption.alias=, this is the user provided keyalias that is used while creating the API project.mastercard.api.idVerify.decryption.keystore.password=, this is the password provided while creating the API project.
Use one of the following two methods:
In the same menu, navigate to the commands ({Project name} > Lifecycle), select clean and compile then click the icon Run Maven Build.
- Navigate to the root directory of the project within a terminal command line window and execute
mvn clean compile install -DskipTests=truecommand.
- Navigate to the
com.mastercard.developerpackage, openApplication.javaand right-click to run.
- Navigate to the root directory of the project within a terminal command line window and execute
mvn spring-boot:run.
- Exit
- Document Data Extraction
- Medicare Card Verification
- Passport Verification
- Driving License Verification
- Document Data Extraction For Web
- User Identity Retrieval
- User Identity Verification
- Trust Score
- Device Authentication
- Device Authentication Verification
- Visa Verification
- SMS OTP
Return a provider token to be passed to the MIDS Liveness SDK module.
-
Details of implementation in class DataExtractionOption
-
First endpoint
../idverify/data-extractions/access-tokensin API Reference, and request data in methodgetAccessTokenExamplein DataExtractionsServiceExample.java. -
Second endpoint
../idverify/data-extractions/scans/{scan_id}in API Reference, and request data constants areSCAN_ID, USER_CONSENT, RETRIEVE_SELFIE, RETRIEVE_DOCUMENT_IMAGES, RETRIEVE_FACEMAP, DOCUMENT_TYPE_DRIVING_LICENSE, USER_SELECTED_COUNTRY
in DataExtractionsServiceExample.java.
Medicare cards API used to verify the identification data associated with a user’s Medicare Card with the Identity Verification Provider.
- Endpoint
../idverify/source-verifications/{issuing_country}/medicare-cardsin API Reference - See details of implementation in class MedicalCareOption
- Request data in method
createSourceVerificationMedicareCardRequestAttributesin SourceVerificationMedicareExample.java.
Verifies the details of a passport document with an identity verification provider.
- Endpoint
../idverify/source-verifications/{issuing_country}/passportsin API Reference - See details of implementation in class PassportSourceVerificationOption
- Request data in method
createSourceVerificationPassportRequestAttributesin SourceVerificationExample.java.
Verifies the details of a driving license document with an identity verification provider.
- Endpoint
../idverify/source-verifications/{issuing_country}/driving-licensesin API Reference - See details of implementation in class DrivingLicenseSourceVerificationOption
- Request data in method
createSourceVerificationDrivingLicenseRequestAttributesin SourceVerificationExample.java.
The provider token is retrieved by country code and SDK version.
- Endpoint
../idverify/data-extractions/access-tokensin API Reference - See details of implementation in class DataExtractionForWebOption
- Request data in method
getAccessTokenExampleForWebin DataExtractionsServiceExample.java.
- Endpoint
../idverify/user-identitiesin API Reference - See details of implementation in class UserIdentityRetrievalOption
- Request data in method
getIdentityin UserExample.java.
- Endpoint
../idverify/user-verificationsin API Reference - See details of implementation in class UserIdentityVerificationOption
- Request data in method
getIdentityVerificationUserInfoin UserExample.java.
- Endpoint
../idverify/trust-scoresin API Reference - See details of implementation in class TrustScoreOption
- Request data in method
getTrustScoreUserInfoin TrustScoreExample.java.
- Endpoint
../idverify/device-authenticationsin API Reference - See details of implementation in class DeviceAuthenticationOption
- Request data in method
getDeviceIpAddressin DeviceAuthenticationExample.java.
- Endpoint
../idverify/device-authentication-verificationsin API Reference - See details of implementation in class DeviceVerificationOption
- Request data in method
getDeviceVerificationFingerprintin DeviceAuthenticationExample.java.
- Endpoint
../idverify/source-verifications/{issuing_country}/passportsin API Reference - See details of implementation in class VisaVerificationOption
- Request data in method
createSourceVerificationPassportRequestAttributesin SourceVerificationExample.java.
../idverify/sms-otpsin API Reference- See details of implementation in class SmsOptFlowOption
- Request data in method
getSmsOtpin SmsOtpExample.java. - This option also execute
/sms-otp-verificationsendpoint to verify the result from previous request.
../idverify/email-otpsin API Reference- See details of implementation in class EmailOptFlowOption
- Request data in method
getEmailOtpin EmailOtpExample.java. - This option also execute
/email-otp-verificationsendpoint to verify the result from previous request.
If you would like further information, please send an e-mail to MC_ID@mastercard.com
- For information regarding licensing, refer to the License file.
- For copyright information, refer to the COPYRIGHT.md.
- For instructions on how to contribute to this project, refer to the Contributing file.
- For changelog information, refer to the CHANGELOG.md.