symfony - Can't login with LDAP and FOSUserbundle in Symfony2 -
i first time using ldap , fosuserbundle , trying implement login using ldap , fosuserbundle , following .yml files
security.yml
security: # preserve plain text password in token refresh user. # analyze security considerations before turn off setting. erase_credentials: false firewalls: main: pattern: ^/ fr3d_ldap: ~ form_login: always_use_default_target_path: false default_target_path: /profile provider: chain_provider logout: true anonymous: true providers: chain_provider: chain: providers: [fos_userbundle, fr3d_ldapbundle] fr3d_ldapbundle: id: fr3d_ldap.security.user.provider fos_userbundle: id: fos_user.user_provider.username encoders: abc\abcbundle\entity\users: plaintext
config.yml
fos_user: db_driver: orm # other valid values 'mongodb', 'couchdb' , 'propel' firewall_name: main user_class: abc\abcbundle\entity\users #ldap fr3d_ldap: driver: host: abc.com port: 389 username: cn=admin,dc=abc,dc=com password: pass1 bindrequiresdn: true # basedn: dc=abc, dc=com accountfilterformat: (&(username=%s)) optreferrals: false # optional # usessl: true # enable ssl negotiation. optional # usestarttls: true # enable tls negotiation. optional accountcanonicalform: 3 accountdomainname: abc.com #accountdomainnameshort: host # if use backslash form set both hostname username converted host\user user: basedn: dc=abc, dc=com filter: (&(objectclass=users)) attributes: # specify ldap attributes mapping [ldap attribute, user object method] - { ldap_attr: username, user_method: setusername } # default # - { ldap_attr: cn, user_method: setname } # optional # - { ldap_attr: ..., user_method: ... } # optional service: user_manager: fos_user.user_manager # overrides default user manager ldap_manager: fr3d_ldap.ldap_manager.default # overrides default ldap manager #ldap_manager: abc.ldap.ldap_manager
routing.yml
fos_user: resource: "@fosuserbundle/resources/config/routing/all.xml" fos_user_security: resource: "@fosuserbundle/resources/config/routing/security.xml" fos_user_profile: resource: "@fosuserbundle/resources/config/routing/profile.xml"
when try login credentials getting exception in try catch block
object(stdclass)#3642 (5) { ["__class__"]=> string(33) "zend\ldap\exception\ldapexception" ["message"]=> string(52) "0x51 (can't contact ldap server): ldap://abc.com:389" ["code"]=> int(81) ["file"]=> string(113) "/home/vishalsabnis/xyz/dcf/vendor/zendframework/zend- ldap/src/ldap.php" ["line"]=> int(836) } prefix: /profile
i don't know miss things
Comments
Post a Comment