kayue / KayueWordpressBundle

A Symfony 2 bundle for providing WordPress repositories and authenticating users (login).
101 stars 43 forks source link

A Token was not found in the SecurityContext. #60

Closed joelurraco closed 9 years ago

joelurraco commented 9 years ago

I am using Symfony 2.3.24 and the 1.2.0 version of this bundle.

I installed and configured the bundle and the firewall, but when I try to enter the secured area, the following exception is thrown:

A Token was not found in the SecurityContext. 500 Internal Server Error - AuthenticationCredentialsNotFoundException

This is my security.yml file, I want all pages to be secured:

security:
    encoders:
        Kayue\WordpressBundle\Entity\User:
            id: kayue_wordpress.security.encoder.phpass

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        wordpress:
            entity: { class: Kayue\WordpressBundle\Entity\User, property: username }

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false

        secured_area:
            pattern:    ^/
            kayue_wordpress: ~

    access_control:
        - { path: ^/, roles: ROLE_ADMIN }
kayue commented 9 years ago

@joelurraco This usually happens when your route is not protected by firewall.

Do you have the complete backtrace log?