Maks3w / FR3DLdapBundle

This bundle integrates LDAP Authentication with any user manager (Ex: FOSUserBundle)
119 stars 77 forks source link

How to set "Username" and "Password" fields from config.yml in the login page #139

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi!

First of all, I am very grateful for the work you have done in FR3DLdapBundle, it is incredibly useful and it helps me a lot.

I am using FR3DLdapBundle with FOSUserBundle. I search for a while how to do the following thing. It works perfectly when I fill the "username" and "password" fields from config.yml with my personal user credentials for the ldap. Then I fill the same credentials in my login page. So I find it is redundant for me and for security purposes, I would like not to have to put my credentials in the config.yml file.

What I want to do: allow people - through my login page using FOSUserBundle - to connect with their personal user credentials without having my personal user credentials in the config.yml file (namely in "username" and "password" fields). I would like to fill those fields directly in the login page.

# config.yml
# ...
fr3d_ldap:
    driver:
        host: mypersonalhost
        port: 389
#        username: I want to comment this field and replace it by the username field from my login page
#        password: I want to comment this field and replace it by the password field from my login page
#        bindRequiresDn: true
        baseDn: 'mybasedn'
ghost commented 7 years ago

I solved my problem by following this link: http://stackoverflow.com/questions/43089644/how-to-set-username-and-password-fields-from-config-yml-in-the-login-page