Comment on page
Mock Authentication System
This guide helps with the steps to mock the authentication server.
Note: It is for development purposes only.
We run the mock identity system, with endpoints to create an individual, authenticate an individual, share data of the individual and mock send-OTP operations.
GitHub Repository
Configurations
- 1.Set the mock implementation details in the
esignet-default.properties
\mosip.esignet.integration.scan-base-package=io.mosip.esignet.mock.integrationmosip.esignet.integration.authenticator=MockAuthenticationServicemosip.esignet.integration.key-binder=MockKeyBindingWrapperServicemosip.esignet.integration.audit-plugin=LoggerAuditServicemosip.esignet.mock.authenticator.get-identity-url=https://${mosip.api.public.host}/v1/mock-identity-system/identitymosip.esignet.mock.authenticator.kyc-auth-url=https://${mosip.api.public.host}/v1/mock-identity-system/kyc-authmosip.esignet.mock.authenticator.kyc-exchange-url=https://${mosip.api.public.host}/v1/mock-identity-system/kyc-exchangemosip.esignet.mock.authenticator.ida.otp-channels=email,phonemosip.esignet.mock.authenticator.send-otp=https://${mosip.api.public.host}/v1/mock-identity-system/send-otpmosip.esignet.mock.supported.bind-auth-factor-types={'WLA'} - 2.Add mock implementation jar into e-Signet service classpath.Build this module : https://github.com/mosip/esignet-mock-services/tree/0.9.0/mock-esignet-integration-impl using below command
mvn clean install -Dgpg.skip=true
- 3.And an entry in the
key_policy_def
table ofmosip_esignet
DB:
INSERT INTO
KEY_POLICY_DEF(APP_ID, KEY_VALIDITY_DURATION, PRE_EXPIRE_DAYS, ACCESS_ALLOWED,
IS_ACTIVE, CR_BY, CR_DTIMES)
VALUES('MOCK_BINDING_SERVICE', 1095, 50, 'NA', true, 'mosipadmin', now());
- 4.To add a new persona, using the create identity endpoint of the mock identity system, add a mock individual into the system.
POST https://api.dev.mosip.net/v1/mock-identity-system/identity
{
"individualId": "6721840162",
"pin": "12345",
"fullName": [
{
"language": "eng",
"value": "Xavier J"
}
],
"gender": [
{
"language": "eng",
"value": "Male"
}
],
"dateOfBirth": "04/08/1857",
"streetAddress": [
{
"language": "eng",
"value": "Cresent road"
}
],
"locality": [
{
"language": "eng",
"value": "CIT colony"
}
],
"region": [
{
"language": "eng",
"value": "Chennai"
}
],
"postalCode": "570100",
"country": [
{
"language": "eng",
"value": "India"
}
],
"encodedPhoto": "string",
"email": "[email protected]",
"phone": "0394423242"
}
With mock individuals created in the mock identity system, The individual ID created could now be used with e-Signet to perform PIN / OTP / BIO / QR-code-based login.
Last modified 1mo ago