Keycloak Java DTOs You Must Know

DTO Name Purpose
UserRepresentation Represents a user in Keycloak. Used for creating, updating, and retrieving users.
RoleRepresentation Represents a role (Realm or Client role) in Keycloak. Used for assigning roles to users/groups.
GroupRepresentation Represents a group in Keycloak. Used for managing group memberships.
CredentialRepresentation Represents a user's credentials (e.g., password, OTP). Used to set or reset passwords.
ClientRepresentation Represents a client (application) in Keycloak. Used for configuring authentication settings.
RealmRepresentation Represents a Keycloak realm. Used for creating and configuring realms.
ProtocolMapperRepresentation Represents a protocol mapper (OIDC, SAML). Used for modifying tokens.
ClientScopeRepresentation Represents client scopes. Used for defining optional and default scopes for clients.