Class KeycloakAdminController

java.lang.Object
com.arms.api.keycloak.admin.controller.KeycloakAdminController

@RestController public class KeycloakAdminController extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGroupRoles(String realm, String groupId, List<org.keycloak.representations.idm.RoleRepresentation> roleRepresentations, org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<Void>
    addMappingGroup(String realm, String user, String groupId)
     
    reactor.core.publisher.Mono<Void>
    addMappingRoles(String realm, String user, List<org.keycloak.representations.idm.RoleRepresentation> rolesToAdd)
     
    reactor.core.publisher.Mono<Void>
    configureSmtp(org.springframework.web.server.ServerWebExchange exchange, String realmName)
     
    void
    createChildGroup(org.springframework.web.server.ServerWebExchange exchange, String realm, String groupId, org.keycloak.representations.idm.GroupRepresentation groupRepresentation)
     
    void
    createGroup(org.springframework.web.server.ServerWebExchange exchange, String realm, org.keycloak.representations.idm.GroupRepresentation groupRepresentation)
     
    void
    createRole(String realm, org.keycloak.representations.idm.RoleRepresentation roleRepresentation)
     
    reactor.core.publisher.Mono<Void>
    createUser(String realm, CreateUserVO createUserVO)
     
    void
    deleteGroup(org.springframework.web.server.ServerWebExchange exchange, String realm, String groupId)
     
    void
    deleteGroupRoles(String realm, String groupId, List<org.keycloak.representations.idm.RoleRepresentation> roleRepresentations, org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<Void>
    deleteMappingGroup(String realm, String user, String groupId)
     
    reactor.core.publisher.Mono<Void>
    deleteMappingRoles(String realm, String user, List<org.keycloak.representations.idm.RoleRepresentation> rolesToRemove)
     
    void
    editGroup(org.springframework.web.server.ServerWebExchange exchange, String realm, String groupId, org.keycloak.representations.idm.GroupRepresentation groupRepresentation)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.GroupRepresentation>>
    getAccessControlGroups(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.UserRepresentation>>
    getAccessControlUsers(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>>
    getAssignedRoles(String realm, String groupId, org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<org.keycloak.admin.client.token.TokenManager>
    getAuthToken(org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>>
    getAvailableRoles(String realm, String groupId, org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.ClientRepresentation>>
    getClient(org.springframework.web.server.ServerWebExchange exchange, String realm, String clientId)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.ClientRepresentation>>
    getClients(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>>
    getComposite(String realm, String groupId, org.springframework.web.server.ServerWebExchange exchange)
     
    List<org.keycloak.representations.idm.GroupRepresentation>
    getFlattenGroup(List<org.keycloak.representations.idm.GroupRepresentation> groupRepresentationList, org.keycloak.representations.idm.GroupRepresentation group)
     
    reactor.core.publisher.Mono<org.keycloak.representations.idm.GroupRepresentation>
    getGroup(org.springframework.web.server.ServerWebExchange exchange, String realm, String groupId)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.GroupRepresentation>>
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.UserRepresentation>>
    getGroupMembers(String realm, String groupId, org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.GroupRepresentation>>
    getGroups(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RealmRepresentation>>
    getRealms(org.springframework.web.server.ServerWebExchange exchange)
     
    reactor.core.publisher.Mono<org.keycloak.representations.idm.RealmRepresentation>
    getRealms(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<org.keycloak.representations.idm.RoleRepresentation>
    getRole(org.springframework.web.server.ServerWebExchange exchange, String realm, String role)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>>
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>>
    getRoles(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<org.keycloak.representations.idm.UserRepresentation>
    getUser(org.springframework.web.server.ServerWebExchange exchange, String realm, String user)
     
    reactor.core.publisher.Mono<List<org.keycloak.representations.idm.UserRepresentation>>
    getUsers(org.springframework.web.server.ServerWebExchange exchange, String realm)
     
    reactor.core.publisher.Mono<Set<org.keycloak.representations.idm.UserRepresentation>>
    getUsersInRole(org.springframework.web.server.ServerWebExchange exchange, String realm, String role)
     
    void
    removeRole(String realm, String role)
     
    void
    removeUser(String realm, String user)
     
    reactor.core.publisher.Mono<Void>
    resetPassword(String realm, String user, org.keycloak.representations.idm.CredentialRepresentation credentialRepresentation)
     
    reactor.core.publisher.Mono<Void>
    testSMTPConnection(org.springframework.web.server.ServerWebExchange exchange, String realm, org.keycloak.representations.idm.RealmRepresentation realmRepresentation)
     
    reactor.core.publisher.Mono<Void>
    updateRealm(org.springframework.web.server.ServerWebExchange exchange, String realm, org.keycloak.representations.idm.RealmRepresentation realmRepresentation)
     
    void
    updateRole(String realm, String role, org.keycloak.representations.idm.RoleRepresentation roleRepresentation)
     
    void
    updateUser(String realm, String user, org.keycloak.representations.idm.UserRepresentation userRepresentation)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KeycloakAdminController

      public KeycloakAdminController()
  • Method Details

    • getAuthToken

      @GetMapping("/auth-admin/token") @ResponseBody public reactor.core.publisher.Mono<org.keycloak.admin.client.token.TokenManager> getAuthToken(org.springframework.web.server.ServerWebExchange exchange)
    • getRealms

      @GetMapping("/auth-admin/realms/") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RealmRepresentation>> getRealms(org.springframework.web.server.ServerWebExchange exchange)
    • getRealms

      @GetMapping("/auth-admin/realms/{realm}") @ResponseBody public reactor.core.publisher.Mono<org.keycloak.representations.idm.RealmRepresentation> getRealms(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)
    • updateRealm

      @PutMapping("/auth-admin/realms/{realm}") @ResponseBody public reactor.core.publisher.Mono<Void> updateRealm(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @RequestBody org.keycloak.representations.idm.RealmRepresentation realmRepresentation)
    • testSMTPConnection

      @PostMapping("/auth-admin/realms/{realm}") @ResponseBody public reactor.core.publisher.Mono<Void> testSMTPConnection(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @RequestBody org.keycloak.representations.idm.RealmRepresentation realmRepresentation)
    • configureSmtp

      @PostMapping("/auth-admin/realms/smtp/{realm}") @ResponseBody public reactor.core.publisher.Mono<Void> configureSmtp(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realmName)
    • getClients

      @GetMapping("/auth-admin/realms/{realm}/clients") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.ClientRepresentation>> getClients(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)
    • getClient

      @GetMapping("/auth-admin/realms/{realm}/client-id/{clientId}") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.ClientRepresentation>> getClient(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("clientId") String clientId)
    • getGroups

      @GetMapping("/auth-admin/realms/{realm}/groups") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.GroupRepresentation>> getGroups(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)
    • getGroup

      @GetMapping("/auth-admin/realms/{realm}/groups/{group-id}") @ResponseBody public reactor.core.publisher.Mono<org.keycloak.representations.idm.GroupRepresentation> getGroup(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("group-id") String groupId)
    • editGroup

      @PutMapping("/auth-admin/realms/{realm}/groups/{group-id}") @ResponseBody public void editGroup(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("group-id") String groupId, @RequestBody org.keycloak.representations.idm.GroupRepresentation groupRepresentation)
    • deleteGroup

      @DeleteMapping("/auth-admin/realms/{realm}/groups/{group-id}") public void deleteGroup(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("group-id") String groupId)
    • createGroup

      @PostMapping("/auth-admin/realms/{realms}/groups") public void createGroup(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realms") String realm, @RequestBody org.keycloak.representations.idm.GroupRepresentation groupRepresentation)
    • createChildGroup

      @PostMapping("/auth-admin/realms/{realms}/groups/{group-id}/children") public void createChildGroup(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realms") String realm, @PathVariable("group-id") String groupId, @RequestBody org.keycloak.representations.idm.GroupRepresentation groupRepresentation)
    • getComposite

      @GetMapping("/auth-admin/realms/{realm}/groups/{group-id}/role-mappings/realm/composite") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>> getComposite(@PathVariable("realm") String realm, @PathVariable("group-id") String groupId, org.springframework.web.server.ServerWebExchange exchange)
    • getAvailableRoles

      @GetMapping("/auth-admin/realms/{realm}/groups/{group-id}/role-mappings/realm/available") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>> getAvailableRoles(@PathVariable("realm") String realm, @PathVariable("group-id") String groupId, org.springframework.web.server.ServerWebExchange exchange)
    • getAssignedRoles

      @GetMapping("/auth-admin/realms/{realm}/groups/{group-id}/role-mappings/realm") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>> getAssignedRoles(@PathVariable("realm") String realm, @PathVariable("group-id") String groupId, org.springframework.web.server.ServerWebExchange exchange)
    • addGroupRoles

      @PostMapping("/auth-admin/realms/{realm}/groups/{group-id}/role-mappings/realm") public void addGroupRoles(@PathVariable("realm") String realm, @PathVariable("group-id") String groupId, @RequestBody List<org.keycloak.representations.idm.RoleRepresentation> roleRepresentations, org.springframework.web.server.ServerWebExchange exchange)
    • deleteGroupRoles

      @DeleteMapping("/auth-admin/realms/{realm}/groups/{group-id}/role-mappings/realm") public void deleteGroupRoles(@PathVariable("realm") String realm, @PathVariable("group-id") String groupId, @RequestBody List<org.keycloak.representations.idm.RoleRepresentation> roleRepresentations, org.springframework.web.server.ServerWebExchange exchange)
    • getGroupMembers

      @GetMapping("/auth-admin/realms/{realm}/groups/{group-id}/members") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.UserRepresentation>> getGroupMembers(@PathVariable("realm") String realm, @PathVariable("group-id") String groupId, org.springframework.web.server.ServerWebExchange exchange)
    • createRole

      @PostMapping("/auth-admin/realms/{realm}/role") public void createRole(@PathVariable("realm") String realm, @RequestBody org.keycloak.representations.idm.RoleRepresentation roleRepresentation)
    • getRoles

      @GetMapping("/auth-admin/realms/{realm}/roles") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>> getRoles(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)
    • getRole

      @GetMapping("/auth-admin/realms/{realm}/role/{role}") @ResponseBody public reactor.core.publisher.Mono<org.keycloak.representations.idm.RoleRepresentation> getRole(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("role") String role)
    • getUsersInRole

      @GetMapping("/auth-admin/realms/{realm}/role/{role}/users") @ResponseBody public reactor.core.publisher.Mono<Set<org.keycloak.representations.idm.UserRepresentation>> getUsersInRole(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("role") String role)
    • updateRole

      @PutMapping("/auth-admin/realms/{realm}/role/{role}") public void updateRole(@PathVariable("realm") String realm, @PathVariable("role") String role, @RequestBody org.keycloak.representations.idm.RoleRepresentation roleRepresentation)
    • removeRole

      @DeleteMapping("/auth-admin/realms/{realm}/role/{role}") public void removeRole(@PathVariable("realm") String realm, @PathVariable("role") String role)
    • createUser

      @PostMapping("/auth-admin/realms/{realm}/user") @ResponseBody public reactor.core.publisher.Mono<Void> createUser(@PathVariable("realm") String realm, @RequestBody CreateUserVO createUserVO)
    • resetPassword

      @PutMapping("/auth-admin/realms/{realm}/user/{user}/reset-password") public reactor.core.publisher.Mono<Void> resetPassword(@PathVariable("realm") String realm, @PathVariable("user") String user, @RequestBody org.keycloak.representations.idm.CredentialRepresentation credentialRepresentation)
    • getUsers

      @GetMapping("/auth-admin/realms/{realm}/users") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.UserRepresentation>> getUsers(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)
    • getUser

      @GetMapping("/auth-admin/realms/{realm}/user/{user}") @ResponseBody public reactor.core.publisher.Mono<org.keycloak.representations.idm.UserRepresentation> getUser(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm, @PathVariable("user") String user)
    • updateUser

      @PutMapping("/auth-admin/realms/{realm}/user/{user}") public void updateUser(@PathVariable("realm") String realm, @PathVariable("user") String user, @RequestBody org.keycloak.representations.idm.UserRepresentation userRepresentation)
    • removeUser

      @DeleteMapping("/auth-admin/realms/{realm}/user/{user}") public void removeUser(@PathVariable("realm") String realm, @PathVariable("user") String user)
    • getRoleMappings

      @GetMapping("/auth-admin/realms/{realm}/user/{user}/role-mappings/realm") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.RoleRepresentation>> getRoleMappings(@PathVariable("realm") String realm, @PathVariable("user") String user)
    • addMappingRoles

      @PostMapping("/auth-admin/realms/{realm}/user/{user}/role-mappings/realm") public reactor.core.publisher.Mono<Void> addMappingRoles(@PathVariable("realm") String realm, @PathVariable("user") String user, @RequestBody List<org.keycloak.representations.idm.RoleRepresentation> rolesToAdd)
    • deleteMappingRoles

      @DeleteMapping("/auth-admin/realms/{realm}/user/{user}/role-mappings/realm") public reactor.core.publisher.Mono<Void> deleteMappingRoles(@PathVariable("realm") String realm, @PathVariable("user") String user, @RequestBody List<org.keycloak.representations.idm.RoleRepresentation> rolesToRemove)
    • getGroupMappings

      @GetMapping("/auth-admin/realms/{realm}/user/{user}/groups") public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.GroupRepresentation>> getGroupMappings(@PathVariable("realm") String realm, @PathVariable("user") String user)
    • addMappingGroup

      @PutMapping("/auth-admin/realms/{realm}/user/{user}/groups/{group-id}") public reactor.core.publisher.Mono<Void> addMappingGroup(@PathVariable("realm") String realm, @PathVariable("user") String user, @PathVariable("group-id") String groupId)
    • deleteMappingGroup

      @DeleteMapping("/auth-admin/realms/{realm}/user/{user}/groups/{group-id}") public reactor.core.publisher.Mono<Void> deleteMappingGroup(@PathVariable("realm") String realm, @PathVariable("user") String user, @PathVariable("group-id") String groupId)
    • getAccessControlUsers

      @GetMapping("/auth-admin/realms/{realm}/access-control/users") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.UserRepresentation>> getAccessControlUsers(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)
    • getFlattenGroup

      public List<org.keycloak.representations.idm.GroupRepresentation> getFlattenGroup(List<org.keycloak.representations.idm.GroupRepresentation> groupRepresentationList, org.keycloak.representations.idm.GroupRepresentation group)
    • getAccessControlGroups

      @GetMapping("/auth-admin/realms/{realm}/access-control/groups") @ResponseBody public reactor.core.publisher.Mono<List<org.keycloak.representations.idm.GroupRepresentation>> getAccessControlGroups(org.springframework.web.server.ServerWebExchange exchange, @PathVariable("realm") String realm)