Class ApiUtil

java.lang.Object
org.keycloak.tests.utils.admin.ApiUtil

public class ApiUtil extends Object
Author:
Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
  • Constructor Details

    • ApiUtil

      public ApiUtil()
  • Method Details

    • getCreatedId

      public static String getCreatedId(jakarta.ws.rs.core.Response response)
    • findClientResourceById

      public static ClientResource findClientResourceById(RealmResource realm, String id)
    • findClientResourceByClientId

      public static ClientResource findClientResourceByClientId(RealmResource realm, String clientId)
    • findClientResourceByName

      public static ClientResource findClientResourceByName(RealmResource realm, String name)
    • findClientByClientId

      public static ClientResource findClientByClientId(RealmResource realm, String clientId)
    • findClientRoleByName

      public static RoleResource findClientRoleByName(ClientResource client, String role)
    • findProtocolMapperByName

      public static org.keycloak.representations.idm.ProtocolMapperRepresentation findProtocolMapperByName(ClientResource client, String name)
    • findProtocolMapperByName

      public static org.keycloak.representations.idm.ProtocolMapperRepresentation findProtocolMapperByName(ClientScopeResource scope, String name)
    • findClientScopeByName

      public static ClientScopeResource findClientScopeByName(RealmResource realm, String clientScopeName)
    • findRealmRoleByName

      public static RoleResource findRealmRoleByName(RealmResource realm, String role)
    • findUserByUsername

      public static org.keycloak.representations.idm.UserRepresentation findUserByUsername(RealmResource realm, String username)
    • findUserByUsernameId

      public static UserResource findUserByUsernameId(RealmResource realm, String username)
    • createUserWithAdminClient

      public static String createUserWithAdminClient(RealmResource realm, org.keycloak.representations.idm.UserRepresentation user)
      Creates a user
      Parameters:
      realm -
      user -
      Returns:
      ID of the new user
    • createUserAndResetPasswordWithAdminClient

      public static String createUserAndResetPasswordWithAdminClient(RealmResource realm, org.keycloak.representations.idm.UserRepresentation user, String password)
      Creates a user and sets the password
      Parameters:
      realm -
      user -
      password -
      Returns:
      ID of the new user
    • createUserAndResetPasswordWithAdminClient

      public static String createUserAndResetPasswordWithAdminClient(RealmResource realm, org.keycloak.representations.idm.UserRepresentation user, String password, boolean temporary)
      Creates a user and sets the password
      Parameters:
      realm -
      user -
      password -
      temporary -
      Returns:
      ID of the new user
    • resetUserPassword

      public static void resetUserPassword(UserResource userResource, String newPassword, boolean temporary)
    • assignRealmRoles

      public static void assignRealmRoles(RealmResource realm, String userId, String... roles)
    • removeUserByUsername

      public static void removeUserByUsername(RealmResource realmResource, String username)
    • assignClientRoles

      public static void assignClientRoles(RealmResource realm, String userId, String clientName, String... roles)
    • groupContainsSubgroup

      public static boolean groupContainsSubgroup(GroupResource groupsResource, org.keycloak.representations.idm.GroupRepresentation subgroup)
    • findAuthorizationSettings

      public static AuthorizationResource findAuthorizationSettings(RealmResource realm, String clientId)
    • updateRequiredActionsOrder

      public static void updateRequiredActionsOrder(RealmResource realmResource, List<org.keycloak.models.UserModel.RequiredAction> requiredActionsInTargetOrder)
      Updates the order of required actions
      Parameters:
      realmResource - the realm
      requiredActionsInTargetOrder - the required actions for which the order should be changed (order will be the order of this list) - can be a subset of the available required actions
      See Also:
    • updateRequiredActionsOrderByAlias

      public static void updateRequiredActionsOrderByAlias(RealmResource realmResource, List<String> requiredActionsInTargetOrder)
      See Also: