sonata-project/SonataAdminBundle — Issue #380: Access denied to /admin/dashboard
Author: saptaru
Created: 2011-11-07 18:35:02+00:00
State: open

Hi,

I am facing one issue when login to backend and cannot tell what I am doing wrong .
I did tried to promote root user as admin, super_admin or administrator ... same issue. If I type a wrong password then the login form validates correctly.
I am using SonataAdminBundle with FOSUserBundle. Here is my security.yml configuration settings :

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

providers:
fos_userbundle:
id: fos_user.user_manager

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

main:
pattern: .*
form-login:
provider: fos_userbundle
login_path: /secured/login
use_forward: false
check_path: /secured/login_check
failure_path: null
default_target_path: /admin/dashboard
logout:
path: /secured/logout
target: /secured/login
anonymous: true

access_control:
# The WDT has to be allowed to anonymous users to avoid requiring the login with the AJAX request
- { path: ^/wdt/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }

# AsseticBundle paths used when using the controller for assets
- { path: ^/js/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/css/, role: IS_AUTHENTICATED_ANONYMOUSLY }

# URL of FOSUserBundle which need to be available to anonymous users
- { path: ^/secured/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/secured/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY } # for the case of a failed login
- { path: ^/user/new$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/check-confirmation-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/confirm/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/confirmed$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/request-reset-password$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/send-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/check-resetting-email$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/reset-password/, role: IS_AUTHENTICATED_ANONYMOUSLY }

# Secured part of the site
# This config requires being logged for the whole site and having the admin role for the admin part.
# Change these rules to adapt them to your needs
- { path: ^/admin/, role: ROLE_ADMIN }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }

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

acl:
connection: default