LdapBundle | based UserProvider for Symfony2 's Security component | Authentication library
kandi X-RAY | LdapBundle Summary
kandi X-RAY | LdapBundle Summary
This bundle implements an LDAP-based UserProvider for Symfony2's Security component. When used in conjunction with Symfony2's HTTP basic authentication listener, this bundle can verify usernames against an LDAP server and populate roles based on groups to which the LDAP user belongs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sets the roles for the given username .
- Create a pre - authentication provider .
- Add security section .
- Returns the configuration tree builder .
- Create a role from an attribute
- Handles the LDAP configuration .
- Resolve entries to attributes .
- Compares two accounts .
- Load LDAP user by username .
- Get pre - authenticated user data .
LdapBundle Key Features
LdapBundle Examples and Code Snippets
Community Discussions
Trending Discussions on LdapBundle
QUESTION
(updated at the end)
I am having trouble registering any user from a specific LDAP as even after finding the user from LDAP, when it tries to register, the username is null, so it triggers a violation constraint and rollsback. Am using Sonata User Bundle, FR3D LDAP Bundle and FOS User Bundle.
dev.log
...ANSWER
Answered 2018-Feb-08 at 11:02My problem was I was only getting like email, sn, cn information after binding with MS Active Directory, not even samaccountname was stored in my User object.
The solution is to use the bundle's custom hydrator:
https://github.com/Maks3w/FR3DLdapBundle/blob/master/Resources/doc/cookbook/custom_hydrator.md. Through this you will be able to get access to every attributes in the LDAP record you searched for. If you follow the documentation it is all you need to fix the said issue.
However, in my version I import existing users via a CSV importer that includes their Usernames from LDAP but I cannot generate their DN string automatically, thus cannot login with only their Usernames, as their DN string contains specific "OU" information.
I solved this issue by loading the user from LDAP on every login to get up-to-date information like DN string and others that change frequently. I then either update an existing user or create a new one depending on repository search result, which also allows imported users to login and no duplicate entries of users. Thanks to ejkun for the elegant solution: https://github.com/Maks3w/FR3DLdapBundle/issues/53#issuecomment-330905167. There's also a bonus on how to detect disabled accounts in AD.
Here is my version of UserHydrator:
QUESTION
I'm using FR3DLdapBundle with FOSUserBundle.
Symfony Version 3.2.6 FR3DLdapBundle Version 3
config.yml
...ANSWER
Answered 2017-May-02 at 14:51you just need to change your baseDn like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install LdapBundle
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page