How to get the group name and Infos of a user?

Hi,

I use fowable as jar inside a java application.
I created a user (with flowable-idm web application) id=“eric”, password=“mypasswd” which belongs to the “grp1” group => ok

procesEngine.getIdentityService().checkPassord(login,password) works fine => ok

Issue : now i need to get the group name to which the user belongs.
I tried to use : procesEngine.getIdentityService().getUserInfo(login,key) => KO : how to get the key for a given user ??

Thanks in advance
:biking_man::biking_woman::biking_man::biking_woman::biking_man::biking_woman:

Hi,

You can use IdentityService to get the group of a user.
Sample query : identityService.createGroupQuery().groupMember(“userId”).list() to get Group class object. Then you can do group.getId() to get Id of the group.

Thanks,
Arpit

It works fine, thank you Arpit.

And for getting info about a user, a solution is :
List listusers = processEngine.getIdentityService().createUserQuery().userId(“my_login”).list();
for(User u : listusers){
System.out.println(u.getFirstName());
}

And Happy New Year 2018 !
:cup_with_straw::wine_glass::cup_with_straw::wine_glass::cup_with_straw::wine_glass::cup_with_straw::wine_glass: