Retrieving users and groups

A GraphQL query can be used to retrieve users and groups.
The following query can be used to retrieve the current authenticated user:

{ 
 secCurrentUser { 
   id 
   shortName 
   displayName 
   distinguishedName 
 } 
} 
The following query can be used to retrieve a specific user by using the id, short name or distinguished name as the identifier:
{ 
 secUser(identifier: "cn=P8Admin,dc=ecm,dc=ibm,dc=com") { 
   id 
   shortName 
   distinguishedName 
 } 
} 
The following query can be used to retrieve a specific group:
{ 
 secGroup(identifier:"cn=P8Admins,dc=ecm,dc=ibm,dc=com") { 
   id 
   shortName 
   displayName 
 } 
} 
You can perform a search to find a list of users. If null is passed for realmIdentifier, the realm of the current authenticated user is used:
{ 
 secUsers( 
   realmIdentifier:null 
   searchPattern:"admin" 
   searchType:CONTAINS 
   searchAttribute:SHORT_NAME 
   sortType:ASCENDING 
 ) 
 { 
   users { 
     id 
     shortName 
     displayName 
     distinguishedName 
   } 
 } 
}
Similarly, you can use secGroups and secRealms to discover groups and realms in the domain.