0
votes

I have created custom user provider in my symfony 2.3 project. In function loadUserByUsername i am calling webservice to authenticate my user. Now my problem is that i want to get password which was entered in login form. So i passed service container as argument by following code

 services:   
     webservice_user_provider:
        class: AppBundle\Security\User\WebserviceUserProvider
        arguments:    ['@service_container']

in my user provider class, i am getting a request object so that i can get password

public function __construct(Container $container) {
    $this->request = $container->get('request');
}

By doing it this way, symfony profiler/toolbar shows message "The security component is disabled". Login works fine but still the message worries me a bit. Is there any other way to get password in user provider/getting container in user provider ?

1
Sounds to me like you should not be writing a custom user provider, but a custom authenticator. See symfony.com/doc/current/cookbook/security/… for an example.Gerry
Thanks Gerry, will try your suggestionJaimin

1 Answers

1
votes

Here is an excelent article about authenticating against a webservice and someone put all that together and pushed it to github

Really helped me a couple of days ago.