Uploaded image for project: 'Apache Fineract'
  1. Apache Fineract
  2. FINERACT-1340

Add client IDs for self-service user in auth credentials

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 1.5.0
    • Component/s: Client, User Management
    • Labels:
      None
    • Docs Text:
      Already documented in swagger

      Description

      -X POST /self/authentication doesn't return a list of clients IDs associated with userId as documented in swagger


       
      Request URL: https://mobile.mifos.io/fineract-provider/api/v1/self/authentication

      curl \
      --header "Content-Type: application/json" \
      --header "Authorization: Basic c2VsZnNlcnZpY2VfaW1vYmlsZTpwYXNzd29yZA==" \
      --header "Fineract-Platform-TenantId: mobile" \
      --request POST \
      --data '{"username":"selfservice_imobile", "password":"password"}' \
      https://mobile.mifos.io/fineract-provider/api/v1/self/authentication --insecure
      

      Returns

      {
         "username":"selfservice_imobile",
         "userId":9,
         "base64EncodedAuthenticationKey":"c2VsZnNlcnZpY2VfaW1vYmlsZTpwYXNzd29yZA\u003d\u003d",
         "authenticated":true,
         "officeId":1,
         "officeName":"FOVISSSTE",
         "roles":[
            {
               "id":2,
               "name":"Self Service User",
               "description":"self service user role",
               "disabled":false
            }
         ],
         "permissions":[
            "REPORTING_SUPER_USER",
            "ALL_FUNCTIONS_READ",
            "BYPASS_TWOFACTOR",
            "CHECKER_SUPER_USER",
            "ALL_FUNCTIONS"
         ],
         "shouldRenewPassword":false,
         "isTwoFactorAuthenticationRequired":false
      }
      

      Expected result

      Test:

      curl \
        --header "Content-Type: application/json" \
        --header "Authorization: Basic bWFrYXJhOnBhc3N3b3Jk" \
        --header "Fineract-Platform-TenantId: default" \
        --request POST \
        --data  '{"username":"makara", "password":"password"}' \
        https://xxxxxx.com.au:9443/fineract-provider/api/v1/self/authentication --insecure
      

      Returns - 

       "clients":[1] as shown in json below

      {
         "username":"makara",
         "userId":6,
         "base64EncodedAuthenticationKey":"bWFrYXJhOnBhc3N3b3Jk",
         "authenticated":true,
         "officeId":1,
         "officeName":"Head Office",
         "roles":[
            {
               "id":2,
               "name":"Self Service User",
               "description":"self service user role",
               "disabled":false
            }
         ],
         "permissions":[
            "ALL_FUNCTIONS"
         ],
         "clients":[
            1
         ],
         "shouldRenewPassword":false,
         "isTwoFactorAuthenticationRequired":false
      }
      

      Use case: I would like to

      1. authenticate customer (self service user), and extract clientId from clients[0] SelfAuthenticationApiResourceSwagger#clients
      2. use the clientId to call -> /self/clients/{clientId}/accounts
        instead of
        a. authenticate
        b. Call -X GET /self/clients List Clients associated to the user
        c. use the clientId to call -> /self/clients/{clientId}/accounts

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                josemakara Joseph Makara
                Reporter:
                josemakara Joseph Makara
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: