On my site, except some spesific pages (login, register, pwd reset) users are required to login. I have implemented remember me feature and it works well.
What I would like to achieve is, for administration pages, users should have admin role and not remembered. To check this requirement I used allow_if in the relevant access_control rule, however it denies my admin user's access, although session is not remembered and I can confirm that session has UsernamePasswordToken on debug toolbar.
My access_control rules are as follows: (4th one doesn't work)
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/user/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin, allow_if: "has_role('ROLE_ADMIN') and has_role('IS_AUTHENTICATED_FULLY')" }
- { path: ^/, role: IS_AUTHENTICATED_REMEMBERED }
If I remove and has_role('IS_AUTHENTICATED_FULLY') part from the relevant access control rule, user can pass authorization so the problem seems to be this part.
What is the problem with has_role('IS_AUTHENTICATED_FULLY') ?
Symfony Version: 2.7.5
IS_AUTHENTICATED_FULLYor maybeIS_AUTHENTICATED_REMEMBERED? Fully is only when the user provider username and password during this specific session. - Benjamin PaapUsernamePasswordToken. If it was a remembered session it would beRememberMeToken. - Lashae