Hi,

-> I have a client in a webTestCase:

$client = $this->createClient();

-> And a firewall:

firewalls:
        backend:
            pattern:    /admin/.*
            security: true

-> Now i want to unit test a controller in the backend:
$client->request('GET', '/admin/');

-> Of course the page is redirect to the login one.

-> I've tried to create a in-memory user but i can't authenticate it:
providers:
        main:
            password_encoder: sha1
            entity: { class: Bundle:Account, property: email }
        test:
            users:
                user: { password: test, roles: ROLE_ADMIN }


-> I've also tried to make a request to the login page with the
client:
$client->request('POST', 'http://example.com/login', array(
        'username' => 'user',
        'password' => 'test'
));



=> Question: What is the best way to authenticate a client ?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to