KeycloakClient

interface KeycloakClient

Interface access resources on keycloak. Build with initKeycloakClient

Functions

addChildGroup
Link copied to clipboard
abstract fun addChildGroup(addGroup: AddGroup, parentGroupId: UUID, realm: String): Response
addClient
Link copied to clipboard
abstract fun addClient(addClient: AddClient, realm: String): Response
addClientMapper
Link copied to clipboard
abstract fun addClientMapper(clientId: UUID, addMapper: AddMapper, realm: String): Response
addClientRole
Link copied to clipboard
abstract fun addClientRole(addRole: AddRole, clientId: UUID, realm: String)
addClientRoleScopeMappingToClient
Link copied to clipboard
abstract fun addClientRoleScopeMappingToClient(roleScopeMapping: List<RoleListItem>, realm: String, id: UUID, roleClientId: UUID): Response
addClientScope
Link copied to clipboard
abstract fun addClientScope(realm: String, addClientScope: AddClientScope): Response
addClientScopeMapper
Link copied to clipboard
abstract fun addClientScopeMapper(clientScopeId: UUID, addMapper: AddMapper, realm: String): Response
addCompositeToRole
Link copied to clipboard
abstract fun addCompositeToRole(roles: List<RoleListItem>, roleId: UUID, realm: String): Response
addFlow
Link copied to clipboard
abstract fun addFlow(realm: String, addFlow: AddFlow): Response
addFlowExecution
Link copied to clipboard
abstract fun addFlowExecution(realm: String, alias: String, addFlowExecution: AddFlowExecution): Response
addGroup
Link copied to clipboard
abstract fun addGroup(addGroup: AddGroup, realm: String): Response
addIdentityProvider
Link copied to clipboard
abstract fun addIdentityProvider(addIdentityProvider: AddIdentityProvider, realm: String): Response
addIdentityProviderMapper
Link copied to clipboard
abstract fun addIdentityProviderMapper(addIdentityProviderMapper: AddIdentityProviderMapper, realm: String, alias: String): Response
addMapper
Link copied to clipboard
abstract fun addMapper(clientId: UUID, addMapper: AddMapper, realm: String): Response
addRealm
Link copied to clipboard
abstract fun addRealm(addRealm: AddRealm)
addRealmRoleScopeMappingToClient
Link copied to clipboard
abstract fun addRealmRoleScopeMappingToClient(roleScopeMapping: List<RoleListItem>, realm: String, id: UUID): Response
addRole
Link copied to clipboard
abstract fun addRole(addRole: AddRole, realm: String)
addSimpleClient
Link copied to clipboard
abstract fun addSimpleClient(addSimpleClient: AddSimpleClient, realm: String): Response
addUser
Link copied to clipboard
abstract fun addUser(user: AddUser, realm: String): Response
addUserFederation
Link copied to clipboard
abstract fun addUserFederation(addUserFederation: AddUserFederation, realm: String)
addUserFederationMapper
Link copied to clipboard
abstract fun addUserFederationMapper(addUserFederationMapper: AddUserFederationMapper, realm: String): Response
assignClientRoles
Link copied to clipboard
abstract fun assignClientRoles(roles: List<AssignRole>, realm: String, userId: UUID, clientId: UUID)
assignClientRolesToGroup
Link copied to clipboard
abstract fun assignClientRolesToGroup(roles: List<AssignRole>, realm: String, groupId: UUID, clientId: UUID)
assignClientRoleToClientScope
Link copied to clipboard
abstract fun assignClientRoleToClientScope(roles: List<AssignRole>, realm: String, clientScopeId: UUID, clientId: UUID): Response
assignDefaultClientScope
Link copied to clipboard
abstract fun assignDefaultClientScope(realm: String, clientId: UUID, clientScopeId: UUID, assignClientScope: AssignClientScope): Response
assignGroup
Link copied to clipboard
abstract fun assignGroup(assignGroup: AssignGroup, realm: String, userId: UUID, groupId: UUID)
assignOptionalClientScope
Link copied to clipboard
abstract fun assignOptionalClientScope(realm: String, clientId: UUID, clientScopeId: UUID, assignClientScope: AssignClientScope): Response
assignRealmRoles
Link copied to clipboard
abstract fun assignRealmRoles(roles: List<AssignRole>, realm: String, userId: UUID)
assignRealmRolesToGroup
Link copied to clipboard
abstract fun assignRealmRolesToGroup(roles: List<AssignRole>, realm: String, groupId: UUID)
assignRealmRoleToClientScope
Link copied to clipboard
abstract fun assignRealmRoleToClientScope(roles: List<AssignRole>, realm: String, clientScopeId: UUID)
client
Link copied to clipboard
abstract fun client(clientId: UUID, realm: String): Client
clientMappers
Link copied to clipboard
abstract fun clientMappers(clientId: UUID, realm: String): List<Mapper>
clientRole
Link copied to clipboard
abstract fun clientRole(roleId: UUID, realm: String, clientId: UUID): Role
clientRoles
Link copied to clipboard
abstract fun clientRoles(realm: String, clientId: UUID): List<RoleListItem>
clientRoleScopeMappingsOfClient
Link copied to clipboard
abstract fun clientRoleScopeMappingsOfClient(realm: String, id: UUID, roleClientId: UUID): List<RoleListItem>
clients
Link copied to clipboard
abstract fun clients(realm: String): List<ClientListItem>
clientScopeClientRoles
Link copied to clipboard
abstract fun clientScopeClientRoles(realm: String, clientScopeId: UUID, clientId: UUID): List<RoleListItem>
clientScopeMappers
Link copied to clipboard
abstract fun clientScopeMappers(clientScopeId: UUID, realm: String): List<Mapper>
clientScopeRealmRoles
Link copied to clipboard
abstract fun clientScopeRealmRoles(realm: String, clientScopeId: UUID): List<RoleListItem>
clientScopes
Link copied to clipboard
abstract fun clientScopes(realm: String): List<ClientScope>
clientSecret
Link copied to clipboard
abstract fun clientSecret(clientId: UUID, realm: String): ClientSecret
clientServiceAccount
Link copied to clipboard
abstract fun clientServiceAccount(clientId: UUID, realm: String): User
defaultClientScopes
Link copied to clipboard
abstract fun defaultClientScopes(realm: String, clientId: UUID): List<ClientScopeItem>
deleteClient
Link copied to clipboard
abstract fun deleteClient(clientId: UUID, realm: String)
deleteClientMapper
Link copied to clipboard
abstract fun deleteClientMapper(clientId: UUID, mapperId: UUID, realm: String)
deleteClientRoleScopeMappingOfClient
Link copied to clipboard
abstract fun deleteClientRoleScopeMappingOfClient(roleScopeMapping: List<RoleListItem>, realm: String, id: UUID, roleClientId: UUID): Response
deleteClientScope
Link copied to clipboard
abstract fun deleteClientScope(realm: String, clientScopeId: UUID): Response
deleteClientScopeMapper
Link copied to clipboard
abstract fun deleteClientScopeMapper(clientScopeId: UUID, mapperId: UUID, realm: String)
deleteFlow
Link copied to clipboard
abstract fun deleteFlow(realm: String, flowId: UUID)
deleteFlowExecution
Link copied to clipboard
abstract fun deleteFlowExecution(realm: String, executionId: UUID)
deleteGroup
Link copied to clipboard
abstract fun deleteGroup(groupUUID: UUID, realm: String): Response
deleteIdentityProvider
Link copied to clipboard
abstract fun deleteIdentityProvider(realm: String, alias: String)
deleteIdentityProviderMapper
Link copied to clipboard
abstract fun deleteIdentityProviderMapper(realm: String, alias: String, id: String)
deleteMapper
Link copied to clipboard
abstract fun deleteMapper(clientId: UUID, mapperId: UUID, realm: String)
deleteRealm
Link copied to clipboard
abstract fun deleteRealm(id: String)
deleteRealmRoleScopeMappingOfClient
Link copied to clipboard
abstract fun deleteRealmRoleScopeMappingOfClient(roleScopeMapping: List<RoleListItem>, realm: String, id: UUID): Response
deleteRequiredAction
Link copied to clipboard
abstract fun deleteRequiredAction(realm: String, alias: String): Response
deleteRole
Link copied to clipboard
abstract fun deleteRole(roleId: UUID, realm: String)
deleteUser
Link copied to clipboard
abstract fun deleteUser(userId: UUID, realm: String)
deleteUserFederation
Link copied to clipboard
abstract fun deleteUserFederation(realm: String, userFederationId: UUID)
deleteUserFederationMapper
Link copied to clipboard
abstract fun deleteUserFederationMapper(realm: String, mapperId: UUID): Response
flowExecutions
Link copied to clipboard
abstract fun flowExecutions(realm: String, alias: String): List<AuthenticationExecution>
flows
Link copied to clipboard
abstract fun flows(realm: String): List<Flow>
getAuthenticatorConfiguration
Link copied to clipboard
abstract fun getAuthenticatorConfiguration(realm: String, configurationId: String): AuthenticatorConfig
getCompositeChildRoles
Link copied to clipboard
abstract fun getCompositeChildRoles(roleId: UUID, realm: String): List<RoleListItem>
group
Link copied to clipboard
abstract fun group(realm: String, groupId: UUID): Group
groupClientRoles
Link copied to clipboard
abstract fun groupClientRoles(realm: String, id: UUID, clientId: UUID): List<RoleListItem>
groupRoles
Link copied to clipboard
abstract fun groupRoles(realm: String, id: UUID): List<RoleListItem>
identityProvider
Link copied to clipboard
abstract fun identityProvider(realm: String, alias: String): IdentityProvider
identityProviderMapper
Link copied to clipboard
abstract fun identityProviderMapper(realm: String, alias: String, name: String): IdentityProviderMapper
identityProviderMappers
Link copied to clipboard
abstract fun identityProviderMappers(realm: String, alias: String): List<IdentityProviderMapper>
identityProviders
Link copied to clipboard
abstract fun identityProviders(realm: String): List<IdentityProvider>
importClient
Link copied to clipboard
abstract fun importClient(importClientRepresentation: ImportClientRepresentation, realm: String): Response
ldapMappers
Link copied to clipboard
abstract fun ldapMappers(realm: String, ldapId: UUID): List<UserFederationMapper>
mappers
Link copied to clipboard
abstract fun mappers(clientId: UUID, realm: String): List<Mapper>
optionalClientScopes
Link copied to clipboard
abstract fun optionalClientScopes(realm: String, clientId: UUID): List<ClientScopeItem>
realmNames
Link copied to clipboard
abstract fun realmNames(): List<RealmName>
realmRoleScopeMappingsOfClient
Link copied to clipboard
abstract fun realmRoleScopeMappingsOfClient(realm: String, id: UUID): List<RoleListItem>
realms
Link copied to clipboard
abstract fun realms(): List<Realm>
realmUserProfile
Link copied to clipboard
abstract fun realmUserProfile(realm: String): RealmProfile
requiredAction
Link copied to clipboard
abstract fun requiredAction(realm: String, alias: String): RequiredActionProviderItem
requiredActions
Link copied to clipboard
abstract fun requiredActions(realm: String): List<RequiredActionProviderItem>
revokeClientRoleFromClientScope
Link copied to clipboard
abstract fun revokeClientRoleFromClientScope(roles: List<AssignRole>, realm: String, clientScopeId: UUID, clientId: UUID): Response
revokeClientRoles
Link copied to clipboard
abstract fun revokeClientRoles(roles: List<AssignRole>, realm: String, userId: UUID, clientId: UUID)
revokeClientRolesFromGroup
Link copied to clipboard
abstract fun revokeClientRolesFromGroup(roles: List<AssignRole>, realm: String, groupId: UUID, clientId: UUID)
revokeGroup
Link copied to clipboard
abstract fun revokeGroup(realm: String, userId: UUID, groupId: UUID)
revokeRealmRoleFromClientScope
Link copied to clipboard
abstract fun revokeRealmRoleFromClientScope(roles: List<AssignRole>, realm: String, clientScopeId: UUID): Response
revokeRealmRoles
Link copied to clipboard
abstract fun revokeRealmRoles(roles: List<AssignRole>, realm: String, userId: UUID)
revokeRealmRolesFromGroup
Link copied to clipboard
abstract fun revokeRealmRolesFromGroup(roles: List<AssignRole>, realm: String, groupId: UUID)
role
Link copied to clipboard
abstract fun role(roleId: UUID, realm: String): Role
roleByName
Link copied to clipboard
abstract fun roleByName(name: String, realm: String): Role
roleByNameResponse
Link copied to clipboard
abstract fun roleByNameResponse(name: String, realm: String): Response
roles
Link copied to clipboard
abstract fun roles(realm: String): List<RoleListItem>
searchByUsername
Link copied to clipboard
abstract fun searchByUsername(username: String, realm: String, exact: Boolean = false, from: Int = 0, max: Int = 100): List<User>
searchGroup
Link copied to clipboard
abstract fun searchGroup(search: String, realm: String): List<GroupListItem>
searchUser
Link copied to clipboard
abstract fun searchUser(search: String, realm: String, max: Int = 100): List<User>
searchUserByQuery
Link copied to clipboard
abstract fun searchUserByQuery(query: String, realm: String, from: Int = 0, max: Int = 100): List<User>
sendEmail
Link copied to clipboard
abstract fun sendEmail(actions: List<EmailActions>, realm: String, userId: UUID, lifespan: Int = 43200)

Sends an email with the specified actions to the user if smtp is configured for this realm

tryUser
Link copied to clipboard
abstract fun tryUser(userId: UUID, realm: String): Response
updateClient
Link copied to clipboard
abstract fun updateClient(clientId: UUID, updateClient: Client, realm: String): Response
updateFlow
Link copied to clipboard
abstract fun updateFlow(realm: String, flowId: UUID, updateFlow: UpdateFlow)
updateFlowExecution
Link copied to clipboard
abstract fun updateFlowExecution(realm: String, alias: String, updateFlowExecution: UpdateFlowExecution): Response
updateFlowExecutionWithNewConfiguration
Link copied to clipboard
abstract fun updateFlowExecutionWithNewConfiguration(realm: String, executionId: String, authenticatorConfig: AuthenticatorConfig): Response
updateGroup
Link copied to clipboard
abstract fun updateGroup(updateGroup: UpdateGroup, realm: String, groupId: UUID): Response
updateIdentityProvider
Link copied to clipboard
abstract fun updateIdentityProvider(updateIdentityProvider: UpdateIdentityProvider, realm: String, alias: String): Response
updateRealm
Link copied to clipboard
abstract fun updateRealm(realmId: String, realm: Realm)
updateRequiredAction
Link copied to clipboard
abstract fun updateRequiredAction(realm: String, alias: String, requiredActionProviderItem: RequiredActionProviderItem): Response
updateRole
Link copied to clipboard
abstract fun updateRole(role: Role, roleId: UUID, realm: String)
updateUser
Link copied to clipboard
abstract fun updateUser(userId: UUID, user: User, realm: String)
updateUserPassword
Link copied to clipboard
abstract fun updateUserPassword(userId: UUID, resetPassword: ResetPassword, realm: String)
user
Link copied to clipboard
abstract fun user(userId: UUID, realm: String): User
userClientRoles
Link copied to clipboard
abstract fun userClientRoles(realm: String, userId: UUID, clientId: UUID): List<RoleListItem>
userFederations
Link copied to clipboard
abstract fun userFederations(realm: String): List<UserFederation>
userGroups
Link copied to clipboard
abstract fun userGroups(realm: String, id: UUID): List<UserGroupListItem>
userRoles
Link copied to clipboard
abstract fun userRoles(realm: String, id: UUID): List<RoleListItem>
users
Link copied to clipboard
abstract fun users(realm: String, max: Int = 100): List<User>
withdrawDefaultClientScope
Link copied to clipboard
abstract fun withdrawDefaultClientScope(realm: String, clientId: UUID, clientScopeId: UUID): Response
withdrawOptionalClientScope
Link copied to clipboard
abstract fun withdrawOptionalClientScope(realm: String, clientId: UUID, clientScopeId: UUID): Response

Extensions

clientById
Link copied to clipboard
fun KeycloakClient.clientById(clientId: String, realm: String): Client
clientMapperExistsByName
Link copied to clipboard
fun KeycloakClient.clientMapperExistsByName(clientId: String, mapperName: String, realm: String): Boolean
clientRoleByName
Link copied to clipboard
fun KeycloakClient.clientRoleByName(name: String, clientId: String, realm: String): Role
clientScopeByName
Link copied to clipboard
fun KeycloakClient.clientScopeByName(name: String, realm: String): ClientScope
clientScopeMapperExistsByName
Link copied to clipboard
fun KeycloakClient.clientScopeMapperExistsByName(clientScopeName: String, mapperName: String, realm: String): Boolean
clientScopeUUID
Link copied to clipboard
fun KeycloakClient.clientScopeUUID(clientScopeName: String, realm: String): UUID
clientUUID
Link copied to clipboard
fun KeycloakClient.clientUUID(clientId: String, realm: String): UUID
executionsToImport
Link copied to clipboard
fun KeycloakClient.executionsToImport(realm: String, flowAlias: String): List<AuthenticationExecutionImport>
existsClient
Link copied to clipboard
fun KeycloakClient.existsClient(clientId: String, realm: String): Boolean
existsClientRole
Link copied to clipboard
fun KeycloakClient.existsClientRole(name: String, realm: String, clientId: String): Boolean
existsClientScope
Link copied to clipboard
fun KeycloakClient.existsClientScope(name: String, realm: String): Boolean
existsGroup
Link copied to clipboard
fun KeycloakClient.existsGroup(name: String, realm: String): Boolean
existsRole
Link copied to clipboard
fun KeycloakClient.existsRole(name: String, realm: String): Boolean
existsUser
Link copied to clipboard
fun KeycloakClient.existsUser(name: String, realm: String): Boolean
groupByName
Link copied to clipboard
fun KeycloakClient.groupByName(name: String, realm: String): Group
groupUUID
Link copied to clipboard
fun KeycloakClient.groupUUID(group: String, realm: String): UUID
identityProviderByAlias
Link copied to clipboard
fun KeycloakClient.identityProviderByAlias(alias: String, realm: String): IdentityProvider
identityProviderExistsByAlias
Link copied to clipboard
fun KeycloakClient.identityProviderExistsByAlias(alias: String, realm: String): Boolean
identityProviderItems
Link copied to clipboard
fun KeycloakClient.identityProviderItems(realm: String): List<IdentityProviderItem>
identityProviderMapperByName
Link copied to clipboard
fun KeycloakClient.identityProviderMapperByName(identityProviderAlias: String, name: String, realm: String): IdentityProviderMapper
identityProviderMapperExistsByName
Link copied to clipboard
fun KeycloakClient.identityProviderMapperExistsByName(identityProviderAlias: String, name: String, realm: String): Boolean
importFlow
Link copied to clipboard
fun KeycloakClient.importFlow(realm: String, importFlow: ImportFlow): UUID
ldapMapperByName
Link copied to clipboard
fun KeycloakClient.ldapMapperByName(ldapName: String, name: String, realm: String): UserFederationMapper
ldapMapperExistsByName
Link copied to clipboard
fun KeycloakClient.ldapMapperExistsByName(ldapName: String, name: String, realm: String): Boolean
realmById
Link copied to clipboard
fun KeycloakClient.realmById(id: String): Realm
realmExistsById
Link copied to clipboard
fun KeycloakClient.realmExistsById(id: String): Boolean
roleExistsByName
Link copied to clipboard
fun KeycloakClient.roleExistsByName(name: String, realm: String): Boolean
fun KeycloakClient.roleExistsByName(name: String, realm: String, client: String): Boolean
updateFlowInPlace
Link copied to clipboard
fun KeycloakClient.updateFlowInPlace(realm: String, alias: String, updateFlow: UpdateFlowInPlace)
userByName
Link copied to clipboard
fun KeycloakClient.userByName(name: String, realm: String): User

File contains a lot of convenience functions when interacting with the keycloak client

userExists
Link copied to clipboard
fun KeycloakClient.userExists(user: UUID, realm: String): Boolean
userFederationByName
Link copied to clipboard
fun KeycloakClient.userFederationByName(name: String, realm: String): UserFederation
userFederationExistsByName
Link copied to clipboard
fun KeycloakClient.userFederationExistsByName(name: String, realm: String): Boolean
userUUID
Link copied to clipboard
fun KeycloakClient.userUUID(user: String, realm: String): UUID