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

**URL:** <https://forum.flowable.org/t/how-to-get-the-group-name-and-infos-of-a-user/1360>\
**Category:** Flowable Engine\
**Created:** [December 21, 2017, 5:46pm UTC](https://forum.flowable.org/t/how-to-get-the-group-name-and-infos-of-a-user/1360 "2017-12-21T17:46:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erixx](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@erixx](https://forum.flowable.org/u/erixx)\
**Post date:** [December 21, 2017, 5:46pm UTC](https://forum.flowable.org/t/how-to-get-the-group-name-and-infos-of-a-user/1360/1 "2017-12-21T17:46:38Z")

</div>

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  
🚴‍♂️🚴‍♀️🚴‍♂️🚴‍♀️🚴‍♂️🚴‍♀️

---

<div class="post-metadata">

**Author:** ![arpit.agrawal](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arpit.agrawal](https://forum.flowable.org/u/arpit.agrawal)\
**Post date:** [December 28, 2017, 7:23am UTC](https://forum.flowable.org/t/how-to-get-the-group-name-and-infos-of-a-user/1360/2 "2017-12-28T07:23:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![erixx](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@erixx](https://forum.flowable.org/u/erixx)\
**Post date:** [January 8, 2018, 4:26pm UTC](https://forum.flowable.org/t/how-to-get-the-group-name-and-infos-of-a-user/1360/3 "2018-01-08T16:26:46Z")

</div>

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 !  
🥤🍷🥤🍷🥤🍷🥤🍷
