Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Following Symfony security docs for "remember me" breaks with Propel provider #179

Closed
eggfriedrice opened this Issue · 2 comments

2 participants

@eggfriedrice

I am using a Propel model for my security, as per the instructions here:
http://www.propelorm.org/cookbook/symfony2/the-symfony2-security-component-and-propel.html

It's all working fine until I try to add a "remember me" box, using the Symfony cookbook recipe here:
http://symfony.com/doc/current/cookbook/security/remember_me.html

Adding the remember me stuff to my security.yml and then clearing the cache gives me this exception:

[RuntimeException]
You must configure at least one remember-me aware listener (such as form-login) for each fire wall that has remember-me enabled.

I've searched around a bit but I'm not finding anything helpful and I don't know enough about the Symfony security component to fix this. Is this a Propel issue?

Cheers,
Al

@havvg
Collaborator

The user provider of the bridge is no listener, it only provides access to stored users.

If you're using the form login, you need to add it to your firewall.

security:
    providers:
        main:
            propel:
                class: Acme\Model\User
                property: username

    firewalls:
        main:
            pattern: ^/
            form_login:
                username_parameter: 'login[username]'
                password_parameter: 'login[password]'
                csrf_parameter:     'login[_token]'
                csrf_provider:      form.csrf_provider

                use_referer:  true
                default_target_path: /

            remember_me:
                key: 'some-unique-key'
                remember_me_parameter: 'login[remember_me]'
@eggfriedrice

Perfect, that was the hint I needed!

Thanks for you your help, I'll close this now.

Cheers,
Al

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.