title: symfony Full authentication is required to access this resource
body: <p>I can not access the admin page from my symfony project.</p>
  
  <p>If I visit XXX.XXX.XXX.XXX/admin I get:</p>
  
  <pre><code>Full authentication is required to access this resource
  </code></pre>
  
  <p>However going to XXX.XXX.XXX.XXX/security/login gives me the login page.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>security:
  
  # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
  providers:
      in_memory:
          memory:
            users:
                admin:
                    password: XXX
                    roles: 'ROLE_ADMIN'
  
  encoders:
      Symfony\Component\Security\Core\User\User:
        algorithm: bcrypt
  
  
  
  firewalls:
      # disables authentication for assets and the profiler, adapt it according to your needs
      dev:
          pattern: ^/(_(profiler|wdt)|css|images|js)/
          security: false
      secured_area:
          pattern: ^/admin
          anonymous: ~
      main:
          anonymous: ~
          # activate different ways to authenticate
  
          # http_basic: ~
          # http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
  
          # form_login: ~
          # http://symfony.com/doc/current/cookbook/security/form_login_setup.html
          form_login:
              login_path: security_login
              check_path: security_login
              csrf_token_generator: security.csrf.token_manager
              default_target_path: userRedirectAction
          logout:
              path: /logout
              target: /blog
  
  access_control:
   # require ROLE_ADMIN for /admin*
    - { path: ^/admin, roles: ROLE_ADMIN }
  </code></pre>