Package org.keycloak.exportimport.util
Class ExportUtils
java.lang.Object
org.keycloak.exportimport.util.ExportUtils
- Author:
- Marek Posolda
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClientRepresentation
exportClient
(KeycloakSession session, ClientModel client) Full export of application including claims and secretexportComponents
(RealmModel realm, String parentId) static CredentialRepresentation
exportCredential
(CredentialModel userCred) static UserRepresentation
exportFederatedUser
(KeycloakSession session, RealmModel realm, String id, ExportOptions options) Full export of user data stored in federated storage (including role mappings and credentials)static void
exportFederatedUsersToStream
(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os) static void
exportFederatedUsersToStream
(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options) static RealmRepresentation
exportRealm
(KeycloakSession session, RealmModel realm, boolean includeUsers, boolean internal) static RealmRepresentation
exportRealm
(KeycloakSession session, RealmModel realm, ExportOptions options, boolean internal) static RoleRepresentation
exportRole
(RoleModel role) Full export of role including composite rolesstatic List<RoleRepresentation>
exportRoles
(Stream<RoleModel> roles) exportSocialLink
(FederatedIdentityModel socialLink) static UserRepresentation
exportUser
(KeycloakSession session, RealmModel realm, UserModel user, ExportOptions options, boolean internal) Full export of user (including role mappings and credentials)static void
exportUsersToStream
(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os) static void
exportUsersToStream
(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options)
-
Constructor Details
-
ExportUtils
public ExportUtils()
-
-
Method Details
-
exportRealm
public static RealmRepresentation exportRealm(KeycloakSession session, RealmModel realm, boolean includeUsers, boolean internal) -
exportRealm
public static RealmRepresentation exportRealm(KeycloakSession session, RealmModel realm, ExportOptions options, boolean internal) -
exportComponents
public static MultivaluedHashMap<String,ComponentExportRepresentation> exportComponents(RealmModel realm, String parentId) -
exportClient
Full export of application including claims and secret- Parameters:
client
-- Returns:
- full ApplicationRepresentation
-
exportRoles
-
exportRole
Full export of role including composite roles- Parameters:
role
-- Returns:
- RoleRepresentation with all stuff filled (including composite roles)
-
exportUser
public static UserRepresentation exportUser(KeycloakSession session, RealmModel realm, UserModel user, ExportOptions options, boolean internal) Full export of user (including role mappings and credentials)- Parameters:
user
-- Returns:
- fully exported user representation
-
exportSocialLink
-
exportCredential
-
exportUsersToStream
public static void exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os) throws IOException - Throws:
IOException
-
exportUsersToStream
public static void exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options) throws IOException - Throws:
IOException
-
exportFederatedUsersToStream
public static void exportFederatedUsersToStream(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os) throws IOException - Throws:
IOException
-
exportFederatedUsersToStream
public static void exportFederatedUsersToStream(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options) throws IOException - Throws:
IOException
-
exportFederatedUser
public static UserRepresentation exportFederatedUser(KeycloakSession session, RealmModel realm, String id, ExportOptions options) Full export of user data stored in federated storage (including role mappings and credentials)- Parameters:
id
-- Returns:
- fully exported user representation
-