To Configure 'phone' as a handle
Note: These configurations can be used when the identities are created through registration client.
IDENTITY SCHEMA
Add the following fields in the identity schema.
1. In the id-schema definitions add the type hash.
"hashType": {
"additionalProperties": false,
"type": "object",
"properties": {
"hash": {
"type": "string"
},
"salt": {
"type": "string"
}
}
}
For the field phone – add the attribute “handle”: true, and add the fields phoneVerified, updatedAt and selectedHandles. Reference given below.
"phone": { "bioAttributes": [], "validators": [ { "validator": "^[+]*([0-9]{1})([0-9]{9})$", "arguments": [], "type": "regex" } ], "fieldCategory": "pvt", "format": "none", "type": "string", "fieldType": "default", "handle": true }, "selectedHandles": { "fieldCategory": "none", "format": "none", "type": "string", "fieldType": "default" }
Publish the identity schema and restart ----> Kernel - master data service, sync service
Id repo services and
Packet manager.Find the sample identity schema with the above changes attached.
DYNAMIC FIELD
Create a dynamic field called phone for selectedHandles → In the admin portal → Master data → Create New Dynamic Field. Reference Given below.
UISPEC
In the new process.json → Add the field selectedHandles in UISPEC [for which the value phone should be populated from the dynamic field] and publish. Reference below.
{ "id": "selectedHandles", "inputRequired": true, "type": "string", "minimum": 0, "maximum": 0, "description": "phone", "label": { "ara": "Select the button to add phone number as handle", "fra": "Select the button to add phone number as handle", "eng": "Select the button to add phone number as handle" }, "controlType": "button", "fieldType": "default", "format": "none", "fieldCategory": "pvt", "alignmentGroup": "contact", "visible": null, "contactType": "email", "group": "selectedHandles", "groupLabel": null, "changeAction": null, "transliterate": false, "templateName": null, "fieldLayout": null, "locationHierarchy": null, "conditionalBioAttributes": null, "required": true, "bioAttributes": null, "requiredOn": [], "subType": "selectedHandles" }
Sync the registration client , if the changes are not reflected restart the master data and sync data services. Refer the picture.
ID-REPOSITORY-DEFAULT PROPERTIES
Add the attribute for postfix as per id-schema in the property below.
mosip.identity.fieldid.handle-postfix.mapping={'phone':'@phone'}
ID-AUTHENTICATION-DEFAULT PROPERTIES
Add the proper regex for phone number validation and include HANDLE for the allowed idtypes in the properties below.
mosip.ida.handle-types.regex={'@phone' : '^[0-9]{10}@phone$' }
request.idtypes.allowed=UIN,VID,HANDLE
IDENTITY-MAPPING.JSON
Add the attributes as given below in the identity mapping json.
note: add the phone number attribute as per the id-schema.
"phone_number_verified": {
"value": "phoneVerified"
},
"updated_at": {
"value": "updatedAt"
},
"individual_id": {
"value": "individual_id"
},
"phone_number": {
"value": "phone"
},
"phone": {
"value": "phone"
},
"phoneNumber": {
"value": "phone"
},
"selectedHandles" : {
"value" : "selectedHandles"
}
DOCKER IMAGES
Deploy the mec image for Idrepo identity service 1.2.1.0
After all these changes, Restart master, sync, idrepo, ida and esignet pods and process a packet.
ensure that the record for handle got inserted in mosip_idrepo --> handle table.
VERIFICATION
Test the changes by sign in with esignet --> login with otp → enter the phone number along with the postfix @phone. for example : 8877665544@phone → get the otp → Verify. Refer the picture below.
----------------------End of the Document--------------------------