Search code examples
phpsymfonyfosuserbundlehwioauthbundle

HWIOAuthBundle with FOSUserBundle and Remember me options


So I have the HWIOAuth Bundle and FOSUserBundle and when I am using the remember me option for some reason it keeps looping in /login/ route. However if I logout and login it works fine till it needs to be refreshed.

My project is a open source one here: https://github.com/LoopTeam/LoopAnime-Website

Security Settings with remember me option enabled here: https://github.com/LoopTeam/LoopAnime-Website/blob/develop/app/config/security.yml

The routes are here: https://github.com/LoopTeam/LoopAnime-Website/blob/develop/app/config/routing.yml

My provider is this one: https://github.com/LoopTeam/LoopAnime-Website/blob/develop/src/LoopAnime/UsersBundle/Security/Core/User/FOSUBUserProvider.php

Can someone tell me what I am doing wrong? Thank you.

-- Edit --

Also this is on my Profiler, so i have the authentication opened but for some reason it loops on login page: http://grab.by/Gru2


Solution

  • The problem was related to the permissions of the paths -- to remember that Symfony has 3 authentications levels from low to high there is - IS_AUTHENTICATED_ANONYMOUSLY , IS_AUTHENTICATED_REMEMBERED and IS_AUTHENTICATED_REMEMBERED

    My index page was set to IS_AUTHENTICATED_REMEMBERED and the remember token is IS_AUTHENTICATED_REMEMBERED changing that for this last one fixed the issue.

    To know more about permissions: http://symfony.com/doc/current/cookbook/security/remember_me.html

    Regards