Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.0
-
None
-
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
- authenticate customer (self service user), and extract clientId from clients[0] SelfAuthenticationApiResourceSwagger#clients
- 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
Attachments
Issue Links
- links to