FriendsOfSymfony/FOSUserBundle — Issue #374: Login failure, an strange issue
Author: MarcosRunroom
Created: 2011-10-19 21:18:08+00:00
State: open

Hi there!
After installing FOSUserBundle on a whole Sonata Structure , Admin, User, News & Page, i was able to log in , and manage my user list, just worked fine.

But yesterday i found a strange issue, that is , if i try to perform a regular login to myapp.local/app_dev.php/login (introducing correct user and password correct pair) as a result i obtain that i'm not logged , returning to my log in form with no error appearing.

I've detected that if i try to log in from app_dev.php/admin/dashboard (acces protected to Admin Profiles ), application redirects me to log in page (as expected), but in this case if we fill user & pass, log in and redirecting to dashboard and just works fine.

Trouble seems to be related to URL referral ¿¿??

Here is my security.yml , thank you so much!

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

SONATA:
- ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT # if you are not using acl then this line must be uncommented

providers:
fos_userbundle:
id: fos_user.user_manager

firewalls:
# Disabling the security for the web debug toolbar, the profiler and Assetic.
# dev:
# pattern: ^/(_(profiler|wdt)|css|images|js)/
#security: false

main:
pattern: .*
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: /login_check
failure_path: null
logout: true
anonymous: true

access_control:
# URL of FOSUserBundle which need to be available to anonymous users
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, 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, ROLE_SONATA_ADMIN] }
- { path: ^/.*, role: ROLE_USER }