In-form authentication / verification & E-Signet
Take a look at our example configuration. Helper form field functions are imported from our NPM library to make it easy to configure offline and online (with E-Signet) plus manual entry fields if you pay close attention to the code.
Look at how these functions are used:
idReaderFields
This function will apply all the UI fields in your forms on the relevant pages for both QR Code reader and E-Signet redirect.
getInitialValueFromIDReader
This function will set the initialValue (pre-population) of a form field and disable it from being edited on succesful scanning of an authentic QR code from an NID card, or successful authentication from E-Signet.
Offline
Observe the qrCodeConfig property to configure the values that will be available for form initialValues (pre-population) from the QRCode supplied by MOSIP on their National ID cards.
Online
Observe the esignetConfig property to see the environment variables that will need to be configured to enable the redirect to E-Signet. The available E-Signet data that can be used as initialValues (pre-population) is configurable in the OPENID_PROVIDER_CLAIMS value.
The mosip-api package handles all communication to/from E-Signet and more environment variables are required to be set there. All of these variables are explained in the next section on Deployment.
Routes required for integration with MOSP ID Auth SDK
In OpenCRVS, some event actions require additional confirmation from the Country Configuration API before they can be accepted. This process is known as action confirmation.
The MOSIP integration uses the Action Confirmation API to communicate with the MOSIP ID Auth SDK when using the offline or manual form field options. This is for a secondary online authentication check once the application is submitted and passes through the OpenCRVS validation, approval and registration status transitions.
The following routes must be added. These routes are critically important to ensure that the record moves through the process successfully.
server.route({
method: 'POST',
path: '/events/{event}/actions/sent-notification',
handler: mosipRegistrationForReviewHandler({
url: env.isProd ? 'http://mosip-api:2024' : 'http://localhost:2024'
}),
options: {
tags: ['api', 'custom-event'],
description: 'Receives notifications on sent-notification action'
}
})
server.route({
method: 'POST',
path: '/events/{event}/actions/sent-notification-for-review',
handler: mosipRegistrationForReviewHandler({
url: env.isProd ? 'http://mosip-api:2024' : 'http://localhost:2024'
}),
options: {
tags: ['api', 'custom-event'],
description:
'Receives notifications on sent-notification-for-review action'
}
})
server.route({
method: 'POST',
path: '/events/{event}/actions/sent-for-approval',
handler: mosipRegistrationForApprovalHandler({
url: env.isProd ? 'http://mosip-api:2024' : 'http://localhost:2024'
}),
options: {
tags: ['api', 'custom-event'],
description: 'Receives notifications on sent-for-approval action'
}
})
Last updated