2

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

Ondrej Slinták
  • 31,386
  • 20
  • 94
  • 126

1 Answers1

1

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
Timo Haberkern
  • 4,409
  • 2
  • 27
  • 41