Hi Symfony community [?]

Hope you are doing well.

I'm being redirected to the Login page in Functional test.

I did:

  $client = $this->createClient();
        $client->followRedirects(true);
        $crawler = $client->request('GET', '/cliente/', array(), array(),
            array('PHP_AUTH_USER' => 'matador', 'PHP_AUTH_PW' => '123'));

        $this->assertEquals(200, $client->getResponse()->getStatusCode());

 $this->assertTrue($crawler->filter('html:contains("Welcome")')->count() >
0);


But the last assert will fail, because the actual response is the Login
page.

If a seek for "Login" instead of "Welcome" in the html filter it will succed
(that is how I know I'm being redirected to the Login page [?])

The password "123" is the uncrypted one, if I set the encrypted one (the one
that is stored in the DB) it will fail anyway.

How can I authenticate a user as for my security configuration???

I appreciate any kind of help [?]

This is my security.yml:

security:
    encoders:
        Comercio\PulperiaBundle\Entity\Cliente:
            algorithm: sha512
            encode-as-base64: true
            iterations: 10

    providers:
        main:
            entity: { class: Comercio\PulperiaBundle\Entity\Cliente,
property: username }

    firewalls:
        profiler:
            pattern:  ^/_profiler
            security: false

        wdt:
            pattern:  ^/_wdt
            security: false

        secured_area:
            pattern:    ^/
            form_login:
                check_path: /login_check
                login_path: /login
                always_use_default_target_path: true
                default_target_path:            /loginredirect
            logout:
                path:   /logout
                target: /
            anonymous: true

    access_control:
        - { path: /admin/, role: ROLE_ADMIN }
        - { path: /cliente/, role: ROLE_CLIENTE }
        - { path: /, role: IS_AUTHENTICATED_ANONYMOUSLY }

-- 
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

<<349.gif>>

<<1E3.gif>>

Reply via email to