Class KeycloakRestRoleService

java.lang.Object
net.n2oapp.security.admin.sso.keycloak.KeycloakRestRoleService

public class KeycloakRestRoleService extends Object
Сервис для создания, изменения, удаления ролей в keycloak
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeycloakRestRoleService(AdminSsoKeycloakProperties properties, org.springframework.web.client.RestClient restClient)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createRole(org.keycloak.representations.idm.RoleRepresentation role)
    Создать роль
    void
    deleteRole(String roleName)
    Удаление роли
    List<org.keycloak.representations.idm.RoleRepresentation>
    Получение всех ролей realm уровня из keycloak
    org.keycloak.representations.idm.RoleRepresentation
    getByName(String roleName)
    Получение роли по уникальному имени(коду)
    List<org.keycloak.representations.idm.RoleRepresentation>
    Получение содержимого роли, в случае если она композитная
    void
    setRestClient(org.springframework.web.client.RestClient restClient)
     
    void
    updateRole(org.keycloak.representations.idm.RoleRepresentation role)
    Изменить роль

    Methods inherited from class java.lang.Object

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

    • KeycloakRestRoleService

      public KeycloakRestRoleService(AdminSsoKeycloakProperties properties, org.springframework.web.client.RestClient restClient)
  • Method Details

    • setRestClient

      public void setRestClient(org.springframework.web.client.RestClient restClient)
    • getByName

      public org.keycloak.representations.idm.RoleRepresentation getByName(String roleName)
      Получение роли по уникальному имени(коду)
      Parameters:
      roleName - имя роля
      Returns:
      роль
    • getAllRoles

      public List<org.keycloak.representations.idm.RoleRepresentation> getAllRoles()
      Получение всех ролей realm уровня из keycloak
      Returns:
      список ролей
    • createRole

      public String createRole(org.keycloak.representations.idm.RoleRepresentation role)
      Создать роль
      Parameters:
      role - данные новой роли
      Returns:
      идентификатор новой роли
    • updateRole

      public void updateRole(org.keycloak.representations.idm.RoleRepresentation role)
      Изменить роль
      Parameters:
      role - данные роли
    • getRoleComposites

      public List<org.keycloak.representations.idm.RoleRepresentation> getRoleComposites(String roleName)
      Получение содержимого роли, в случае если она композитная
      Parameters:
      roleName - имя роли
      Returns:
      список ролей
    • deleteRole

      public void deleteRole(String roleName)
      Удаление роли
      Parameters:
      roleName - имя роли