Skip to content

Commit

Permalink
Fix yml and MapbenderLdapBindAuthenticationProvider for Mapbender 3.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilVanB committed Sep 16, 2021
1 parent 52e0f24 commit 7493d49
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
33 changes: 17 additions & 16 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@ services:
ldapClient:
class: Symfony\Component\Ldap\LdapClient
arguments:
- %ldap.host% #Address to LDAPServer
- %ldap.port% #Port where LDAPServer is listening
- %ldap.version% #LDAP Protocol version
- %ldap.useSSL% # SSL #Use SSL
- %ldap.useTLS% # TLS 'Use TLS
ldapUserProvider:
- '%ldap.host%' #Address to LDAPServer
- '%ldap.port%' #Port where LDAPServer is listening
- '%ldap.version%' #LDAP Protocol version
- '%ldap.useSSL%' # SSL #Use SSL
- '%ldap.useTLS%' # TLS 'Use TLS
LDAPUserProvider:
class: Mapbender\LDAPBundle\Security\Provider\LDAPUserProvider
arguments:
- @ldapClient
- %ldap.bind.dn%
- %ldap.bind.pwd%
- %ldap.user.baseDN%
- %ldap.user.query%
- %ldap.group.baseDN%
- %ldap.group.query%
- '@ldapClient'
- '%ldap.bind.dn%'
- '%ldap.bind.pwd%'
- '%ldap.user.baseDN%'
- '%ldap.user.query%'
- '%ldap.group.baseDN%'
- '%ldap.group.query%'
- [ROLE_USER]
- %ldap.group.id%
- '%ldap.group.id%'
security.authentication.provider.mbldap:
class: Mapbender\LDAPBundle\Security\Provider\MapbenderLdapBindAuthenticationProvider
arguments:
- @ldapClient
- '@ldapClient'
-
-
-
-
- %ldap.user.dn%
- '%ldap.user.dn%'
-
- '%ldap.user.query%'



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MapbenderLdapBindAuthenticationProvider extends LdapBindAuthenticationPro
private $dnString;
private $encoderFactory;

public function __construct(UserProviderInterface $userProvider, UserCheckerInterface $userChecker, $providerKey, LdapClientInterface $ldap, EncoderFactoryInterface $encoderFactory,$dnString = '{cn=username}', $hideUserNotFoundExceptions = true)
public function __construct(UserProviderInterface $userProvider, UserCheckerInterface $userChecker, $providerKey, LdapClientInterface $ldap, EncoderFactoryInterface $encoderFactory,$dnString = '{cn=username}', $hideUserNotFoundExceptions = true, $userQuery)
{
parent::__construct( $userProvider, $userChecker, $providerKey, $ldap, $dnString, $hideUserNotFoundExceptions);

Expand All @@ -36,6 +36,10 @@ public function __construct(UserProviderInterface $userProvider, UserCheckerInte
$this->encoderFactory = $encoderFactory ;
$this->dnString = $dnString;

// support Mapbender < 3.2.x (Symfony 2.8)
if (method_exists(get_parent_class($this), 'setQueryString')) {
$this->setQueryString($userQuery);
}
}


Expand Down

0 comments on commit 7493d49

Please sign in to comment.