Package org.gcube.service.idm.controller
Class KCUserController
- java.lang.Object
-
- org.gcube.service.idm.controller.KCUserController
-
public class KCUserController extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringMEMBER_ROLE_NAME
-
Constructor Summary
Constructors Constructor Description KCUserController()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<org.keycloak.representations.idm.ClientRepresentation>clients()static List<org.keycloak.representations.idm.UserRepresentation>contextUsers(Integer firstResult, Integer maxResults)static ObjectformatList(List<org.keycloak.representations.idm.UserRepresentation> users, org.gcube.idm.common.models.IdmUser.USERS_REPR format)static ObjectformatRepr(org.keycloak.representations.idm.UserRepresentation user, org.gcube.idm.common.models.IdmUser.USERS_REPR format)static org.keycloak.representations.idm.UserRepresentationgetUserByEmail(String email)static org.keycloak.representations.idm.UserRepresentationgetUserById(String username)static org.keycloak.representations.idm.UserRepresentationgetUserByUsername(String username)static ObjectgetUserParameter(String username, String parameter)static org.keycloak.admin.client.resource.UserResourcegetUserResourceByUsername(String username)static List<org.keycloak.representations.idm.UserRepresentation>realmUser(Integer firstResult, Integer maxResults)static org.keycloak.admin.client.resource.UsersResourcerealmUsersResource()static List<org.keycloak.representations.idm.UserRepresentation>search(String username, String firstName, String lastName, String email, Boolean emailVerified, String idpAlias, String idpUserId, Integer firstResult, Integer maxResults, Boolean enabled, Boolean briefRepresentation)Search for users based on the given filters.static List<org.keycloak.representations.idm.UserRepresentation>searchUsersByRole(String roleName, Integer firstResult, Integer maxResults)
-
-
-
Field Detail
-
MEMBER_ROLE_NAME
public static String MEMBER_ROLE_NAME
-
-
Method Detail
-
realmUsersResource
public static org.keycloak.admin.client.resource.UsersResource realmUsersResource()
-
realmUser
public static List<org.keycloak.representations.idm.UserRepresentation> realmUser(Integer firstResult, Integer maxResults)
-
contextUsers
public static List<org.keycloak.representations.idm.UserRepresentation> contextUsers(Integer firstResult, Integer maxResults)
-
formatRepr
public static Object formatRepr(org.keycloak.representations.idm.UserRepresentation user, org.gcube.idm.common.models.IdmUser.USERS_REPR format)
-
formatList
public static Object formatList(List<org.keycloak.representations.idm.UserRepresentation> users, org.gcube.idm.common.models.IdmUser.USERS_REPR format)
-
search
public static List<org.keycloak.representations.idm.UserRepresentation> search(String username, String firstName, String lastName, String email, Boolean emailVerified, String idpAlias, String idpUserId, Integer firstResult, Integer maxResults, Boolean enabled, Boolean briefRepresentation)
Search for users based on the given filters.- Parameters:
username- a value contained in usernamefirstName- a value contained in first namelastName- a value contained in last nameemail- a value contained in emailemailVerified- whether the email has been verifiedidpAlias- the alias of the Identity ProvideridpUserId- the userId at the Identity ProviderfirstResult- the position of the first result to retrievemaxResults- the maximum number of results to retrieveenabled- only return enabled or disabled usersbriefRepresentation- Only return basic information (only guaranteed to return id, username, created, first and last name, email, enabled state, email verification state, federation link, and access. Note that it means that namely user attributes, required actions, and not before are not returned.)- Returns:
- a list of
UserRepresentation
-
getUserByEmail
public static org.keycloak.representations.idm.UserRepresentation getUserByEmail(String email)
-
getUserById
public static org.keycloak.representations.idm.UserRepresentation getUserById(String username)
-
getUserByUsername
public static org.keycloak.representations.idm.UserRepresentation getUserByUsername(String username)
-
getUserResourceByUsername
public static org.keycloak.admin.client.resource.UserResource getUserResourceByUsername(String username)
-
searchUsersByRole
public static List<org.keycloak.representations.idm.UserRepresentation> searchUsersByRole(String roleName, Integer firstResult, Integer maxResults)
-
clients
public static List<org.keycloak.representations.idm.ClientRepresentation> clients()
-
-