Class LdapClient

java.lang.Object
pro.taskana.common.rest.ldap.LdapClient

@Component public class LdapClient extends Object
Class for Ldap access.
  • Constructor Details

    • LdapClient

      @Autowired public LdapClient(org.springframework.core.env.Environment env, org.springframework.ldap.core.LdapTemplate ldapTemplate, pro.taskana.TaskanaConfiguration taskanaConfiguration)
  • Method Details

    • searchUsersAndGroups

      public List<AccessIdRepresentationModel> searchUsersAndGroups(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Search LDAP for matching users or groups.
      Parameters:
      name - lookup string for names or groups
      Returns:
      a list of AccessIdResources sorted by AccessId and limited to maxNumberOfReturnedAccessIds
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException - if input is shorter than minSearchForLength
    • searchUsersByNameOrAccessIdInUserRole

      public List<AccessIdRepresentationModel> searchUsersByNameOrAccessIdInUserRole(String nameOrAccessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
    • searchUsersInUserRole

      public List<pro.taskana.user.api.models.User> searchUsersInUserRole()
    • searchUsersByNameOrAccessId

      public List<AccessIdRepresentationModel> searchUsersByNameOrAccessId(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
    • getUsersByAccessId

      public List<AccessIdRepresentationModel> getUsersByAccessId(String accessId)
    • searchGroupsByName

      public List<AccessIdRepresentationModel> searchGroupsByName(String name) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
    • searchAccessIdByDn

      public AccessIdRepresentationModel searchAccessIdByDn(String dn)
    • searchGroupsAccessIdIsMemberOf

      public List<AccessIdRepresentationModel> searchGroupsAccessIdIsMemberOf(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
    • searchDnForAccessId

      public String searchDnForAccessId(String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Performs a lookup to retrieve correct DN for the given access id.
      Parameters:
      accessId - The access id to lookup
      Returns:
      the LDAP Distinguished Name for the access id
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException - thrown if the given access id is ambiguous.
    • validateAccessId

      public boolean validateAccessId(String name)
      Validates a given AccessId / name.
      Parameters:
      name - lookup string for names or groups
      Returns:
      whether the given name is valid or not
    • getUserSearchBase

      public String getUserSearchBase()
    • getUserSearchFilterName

      public String getUserSearchFilterName()
    • getUserSearchFilterValue

      public String getUserSearchFilterValue()
    • getUserFirstnameAttribute

      public String getUserFirstnameAttribute()
    • getUserLastnameAttribute

      public String getUserLastnameAttribute()
    • getUserPhoneAttribute

      public String getUserPhoneAttribute()
    • getUserMobilePhoneAttribute

      public String getUserMobilePhoneAttribute()
    • getUserEmailAttribute

      public String getUserEmailAttribute()
    • getUserOrgLevel1Attribute

      public String getUserOrgLevel1Attribute()
    • getUserOrgLevel2Attribute

      public String getUserOrgLevel2Attribute()
    • getUserOrgLevel3Attribute

      public String getUserOrgLevel3Attribute()
    • getUserOrgLevel4Attribute

      public String getUserOrgLevel4Attribute()
    • getUserIdAttribute

      public String getUserIdAttribute()
    • getUserMemberOfGroupAttribute

      public String getUserMemberOfGroupAttribute()
    • getUserPermissionsAttribute

      public String getUserPermissionsAttribute()
    • getGroupSearchBase

      public String getGroupSearchBase()
    • getBaseDn

      public String getBaseDn()
    • getGroupSearchFilterName

      public String getGroupSearchFilterName()
    • getGroupSearchFilterValue

      public String getGroupSearchFilterValue()
    • getGroupNameAttribute

      public String getGroupNameAttribute()
    • calcMinSearchForLength

      public int calcMinSearchForLength(int defaultValue)
    • getMinSearchForLength

      public int getMinSearchForLength()
    • calcMaxNumberOfReturnedAccessIds

      public int calcMaxNumberOfReturnedAccessIds(int defaultValue)
    • getMaxNumberOfReturnedAccessIds

      public int getMaxNumberOfReturnedAccessIds()
    • getGroupsOfUserName

      public String getGroupsOfUserName()
    • getGroupsOfUserType

      public String getGroupsOfUserType()
    • isUser

      public boolean isUser(String accessId)