To Build Mock MDS for Authentication

 Part -1 To configure and build the partner management tool

 

Step 1

  Download the zip file of the Partner-management tool using the link given below
note: download the appropriate branch needed(Here used is 1.2.0).

https://github.com/mosip/gist/tree/1.2.0

 Step 2:        

  Unzip and through the path → gist-1.2.0\partnermanagement\src\main\resources

open the  application.properties and do the changes mentioned below.

 

  1. Change the url of the relevant environment being used.

                                            

2. Update the key of the

mosip-pms-client at the place of   mosip.authenticate.client.secretkey.

refer below.

3. Update the key of the

mosip-reproc-client at the place of  token.request.secretKey.

reference below.

 

     

4. Create one user in keycloak or for the existing user -assign the roles PARTNER_ADMIN, PMS_ADMIN And  POLICYMANAGER in keycloak.
and as per the picture change the username and password as per the user u have.

Save the property file.

5. Now Build the tool using the command given below and refer the picture for the build path.

mvn clean install -Dgpg.skip=true -Dmaven.test.skip=true 

 

6. After the successful build, A target folder is been generated.

Now run the jar using the command given below and refer the picture for the path.

java -jar partnermanagement-0.0.1-SNAPSHOT.jar

 

7. By running the jar, the below swagger url will be accessible to create the partner.

http://localhost:9091/v1/partnermanager/swagger-ui.html

Note: Keep the jar file running so that the swagger link be accessible.

 

Part-2 To Create User for Device and Ftm partner in keycloak

Step 1: 

       Login to the keycloak --> users --> add users-->fill in the details and save.

Create two users one is for Device partner and other is for FTM partner.

               Username example – 1. For Device partner - mpartner-L1-device-01 and

2. For FTM partner -mpartner-L1-ftm-01.

 Step 2:

Set the password in the credentials option.
Note : Copy the password from the application.properties of the Partner management  tool

and use here.

 

Step 3:

For the created user assign the roles in the role mapping option as below.

  •    For the Device partner user, map the role – DEVICE_PROVIDER from the available roles.

  • For the ftm partner user, map the role – FTM_PROVIDER from the available roles.

 

Part-3 To Register AUTH partner

Step 1:

              To Register auth partner, Use the swagger (refer part 1-- > step 7)-->

configureL1Device → try it out--> copy and paste the below given body

and execute.

Note:  Edit the partner id and organization name as same as

You’ve created. Refer below.

{

  "configurationType": "MOCK",

  "deviceProvider": {

    "partnerAddress": "Bengaluru",

    "partnerContactNumber": "9999999999",

    "partnerEmailId": "device1@gmail.com",

    "partnerId": "mpartner-l1-device-01",

    "partnerOrganizationName": "mpartner-l1-device-01",

    "partnerType": "DEVICE"

  },

  "environmentVersion": "LTS",

  "ftmProvider": {

    "partnerAddress": "Bengaluru",

    "partnerContactNumber": "9999999999",

    "partnerEmailId": "ftm1@gmail.com",

    "partnerId": "mpartner-l1-ftm-01",

    "partnerOrganizationName": "mpartner-l1-ftm-01",

    "partnerType": "FTM"

  }

}

Step 5 : 

             After the partner creation,  .p12 file will be generated inside the temp folder. Find the temp folder

in the below mentioned path.

             C:\Users\hp\AppData\Local\Temp\IDA-localhost\mpartner-device-01 (Or Use windows + R and search %temp%)

Step 6 :

 Copy the device partner certificate some where and rename as mentioned below

example: 1. device-partner.p12 as Device.p12.

2. ftm-partner.p12 as mosipfaceftm.p12(for face)

3. ftm-partner.p12 as mosipfingerslapftm.p12 (for fingers)

Step 7 :

  1. Download the latest mock MDS .zip from the URL: https://github.com/mosip/mosip-mock-services/tree/master

  2. Place the device certificates created in the certificate paths as highlighted below in the mock MDS:

  3. Modify the “application.properties” file as below after placing the certificates are placed.

  4. Modify the below changes in the “application.properties” file.

     

  5. Build the MDS in the command prompt in the same directory where the pom file exists
    run “

mvn clean install -Dgpg.skip=true -Dmaven.test.skip=true 

  1. ”,a target folder will be generated and it can be used as the mock mds folder further.

  2. Run the Run.bat file to run the mock mds, The highlighted line shows that the mock mds is running.

----------------------------------------------------------------------------------------------