New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The handling of the remember_me does not work in the LoginManager #747
Comments
How should i fix it? |
Good question by @wiistriker. I would gladly help if anyone has an idea on how to fix this now that the remember me services are private. What is the best practice to set the remember me cookie manually? |
@wiistriker I don't know how to fix it, otherwise it would already be in the bundle. @schmittjoh do you have an idea ? |
@stof take a look at https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php#L73 |
In http://symfony.com/doc/master/components/dependency_injection/advanced.html#aliasing part of docs:
so in services.yml:
and i can get this service and use it. Only problem that we should hardcode Another thing that |
ping @stof @schmittjoh ^^^ what do you think? maybe there is some way to create alias for services inside bundle's extension? |
Any update about this? |
@wiistriker: no it's not possible. it doesn't have access to the full container. It would have to be done in a compiler pass. |
@jrobeson but it's work |
which file? your services.yml? yes it would work there. I was referring to the extension. |
@wiistriker: see this: http://symfony.com/doc/master/components/dependency_injection/compilation.html#managing-configuration-with-extensions
|
+1 |
2 similar comments
+1 |
+1 |
The firewall name is already configured so using a CompilerPass to set the the correct Remember-me service would work right? The only problem is that the service is always initialized (even when not needed), this can alternatively be solved with lazy loading. But I'm not sure if injecting really results in overhead, how many times is this service initialized? From what I know the Service is only loaded when its dispatched, and that only happens on resetting and registering. As a last possibility we can determine the remember-me service and change the public=false to true in a CompilerPass at least until or when lazy-loading is not possible. Any thoughts on this?? |
up, because it's important to fix the problem :( |
but if not possible. how it working in SonataAdminBundle login? |
This issue relates to the SonataAdminBundle doesn't do anything in regards to authentication, it relies on a properly configured firewall to handle that. |
No fix found ? |
To be fair, I haven't spent time to find a fix yet (and nobody has found it annoying enough to contribute a fix) |
At date always the bug ? |
any workaround for this? |
@stof what about sirian's fix ? |
The remember me services are private so they are removed from the container when optimizing it. This means that the
has
checks in the LoginManager will returnfalse
even when the remember me is activated for the firewall./cc @schmittjoh
The text was updated successfully, but these errors were encountered: