It was required that my application uses a SSO Service called Shibboleth. So I used the existing shibboleth-bundle. Things have changed and we need to add a form authentication method for the user. So I decided to implement Shibboleth authentication with the new Guard Component. (See ShibbolethGuardBundle)
I found a problem during the development. Symfony calls the ShibbolethAuthenticator
methods at the first request, creates a token and never calls any ShibbolethAuthenticator
method on later requests. That means, if Shibboleth session ends the user is still authenticated using the Symfony session.
This is also a problem if you want to implement a token authentication. The user only need to send the token at the first request. Any other request is authenticated by the session.
This problem exist also with other SSO services. If you logout at Facebook you want to be logged out at any website that uses Facebook authentication. But if you implemented this with Guard you still have a valid session after the logout at facebook.
I found a quick solution by checking if the shibboleth header variables are set in my UserProvider
on every request. If they are missing, an Exception is called and my ExceptionListener
redirects to the login page.
I think this is not a good solution, because the ShibbolethGuardBundle should handle this problem. Does anyone has an idea how I could solve this in a more appropriate way?