Class ProxyLDAPAuthoritiesPopulator

java.lang.Object
org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
org.jenkinsci.plugins.reverse_proxy_auth.service.ProxyLDAPAuthoritiesPopulator
All Implemented Interfaces:
org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator

public class ProxyLDAPAuthoritiesPopulator extends org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
LdapAuthoritiesPopulator that adds the automatic 'authenticated' role.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProxyLDAPAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Set<org.springframework.security.core.GrantedAuthority>
    getAdditionalRoles(org.springframework.ldap.core.DirContextOperations user, String username)
     
    Set<org.springframework.security.core.GrantedAuthority>
    Retrieves the group membership in two ways.
    void
    setConvertToUpperCase(boolean convertToUpperCase)
     
    void
    setRolePrefix(String rolePrefix)
     

    Methods inherited from class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator

    getContextSource, getGrantedAuthorities, getGroupRoleAttribute, getGroupSearchBase, getGroupSearchFilter, getLdapTemplate, getRolePrefix, isConvertToUpperCase, setAuthorityMapper, setDefaultRole, setGroupRoleAttribute, setGroupSearchFilter, setIgnorePartialResultException, setSearchSubtree

    Methods inherited from class java.lang.Object

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

    • ProxyLDAPAuthoritiesPopulator

      public ProxyLDAPAuthoritiesPopulator(org.springframework.ldap.core.ContextSource contextSource, String groupSearchBase)
  • Method Details

    • getAdditionalRoles

      protected Set<org.springframework.security.core.GrantedAuthority> getAdditionalRoles(org.springframework.ldap.core.DirContextOperations user, String username)
      Overrides:
      getAdditionalRoles in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
    • setRolePrefix

      public void setRolePrefix(String rolePrefix)
      Overrides:
      setRolePrefix in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
    • setConvertToUpperCase

      public void setConvertToUpperCase(boolean convertToUpperCase)
      Overrides:
      setConvertToUpperCase in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator
    • getGroupMembershipRoles

      public Set<org.springframework.security.core.GrantedAuthority> getGroupMembershipRoles(String userDn, String username)
      Retrieves the group membership in two ways.

      We'd like to retain the original name, but we historically used to do "ROLE_GROUPNAME". So to remain backward compatible, we make the super class pass the unmodified "groupName", then do the backward compatible translation here, so that the user gets both "ROLE_GROUPNAME" and "groupName".

      Overrides:
      getGroupMembershipRoles in class org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator