8000 [Security] Fix accepting null as $uidKey in LdapUserProvider by louhde · Pull Request #27847 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Fix accepting null as $uidKey in LdapUserProvider #27847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Security] LdapUserProvider uidKey could be null
  • Loading branch information
louhde committed Jul 4, 2018
commit c77625988d3e72bfe6c4c14c15a57e04998843fd
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ class LdapUserProvider implements UserProviderInterface
private $defaultSearch;
private $passwordAttribute;

public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), ?string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
{
if (null === $uidKey) {
$uidKey = 'sAMAccountName';
}

$this->ldap = $ldap;
$this->baseDn = $baseDn;
$this->searchDn = $searchDn;
Expand Down
0