Class KCUserController


  • public class KCUserController
    extends Object
    • Field Detail

      • MEMBER_ROLE_NAME

        public static String MEMBER_ROLE_NAME
    • Constructor Detail

      • KCUserController

        public KCUserController()
    • 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,
                                        KCUserController.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 username
        firstName - a value contained in first name
        lastName - a value contained in last name
        email - a value contained in email
        emailVerified - whether the email has been verified
        idpAlias - the alias of the Identity Provider
        idpUserId - the userId at the Identity Provider
        firstResult - the position of the first result to retrieve
        maxResults - the maximum number of results to retrieve
        enabled - only return enabled or disabled users
        briefRepresentation - 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()
      • getUserParameter

        public static Object getUserParameter​(String username,
                                              String parameter)