Get User Details
Catalyst Authentication provides some variants to retrieve the details of the app users. It is possible to obtain the user information of the current user, any, or all users of the application.
Get Current User Details
This code fetches the details of an user on whose scope the function is getting executed.
Ensure that the following packages are imported:
copyimport com.zc.component.ZCUserDetail; import com.zc.component.users.ZCUser;
copy//Create an instance of the ZCUser object to get current user information ZCUserDetail details = ZCUser.getInstance().getCurrentUser();
Get All User Details
This code can fetch the details of all the users who are registered with the application.
Ensure the following packages are imported:
copyimport com.zc.component.ZCUserDetail; import com.zc.component.users.ZCUser;
copy//Create an instance of ZCUser and call getAllUser to get all the users in the application List<ZCUserDetail> details = ZCUser.getInstance().getAllUser();
Get User Details by User ID
Unlike the previous code, when you want to retrieve the information of a particular user, you can use this code where the User ID of the user is passed as a parameter to the getUser() method.
Ensure the following packages are imported:
copyimport com.zc.component.ZCUserDetail; import com.zc.component.users.ZCUser;
copy//Create an instance of the ZCUser object and use user id to get user information based on id ZCUserDetail details = ZCUser.getInstance().getUser(1510000000113214L);
Last Updated 2023-09-03 01:06:41 +0530 +0530
Yes
No
Send your feedback to us
Skip
Submit