0

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 ?

2
  • 4
    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. Commented Jan 19, 2015 at 16:31
  • Thanks Gerry, will try your suggestion Commented Jan 20, 2015 at 8:30

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.