2
votes

I tried to configure a simple secured admin area by configuring it into secury.yml. I used the example of Symfony :

    security:
        firewalls:
            secured_area:
                pattern:    ^/
                anonymous: ~
                http_basic:
                    realm: "Secured Admin Area"

        access_control:
            - { path: ^/admin, roles: ROLE_ADMIN }

        providers:
            in_memory:
                users:
                    ryan:  { password: ryanpass, roles: 'ROLE_USER' }
                    admin: { password: kitten, roles: 'ROLE_ADMIN' }

        encoders:
            Symfony\Component\Security\Core\User\User: plaintext

I have the username / password prompt, but the couples ryan:ryanpass and admin:kitten doesn't work. Is there something wrong ?

Thank you

1
Are you sure it gives you the same error? ryan should give you 403 and admin 404 (I guess route /admin doesn't exist in your application).Ondrej Slinták
I don't have any error. It just prompt again, like password wasn't good...Julie Laporte
And yes, the route /admin exists ;)Julie Laporte
you dont need quotes i guess in rolesGorillaApe

1 Answers

1
votes

I think you need to add the provider name to the http_basic section in your case:

http_basic:
    realm: "Secured Admin Area"
    provider: in_memory