Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[5.3 ]concrete service no more generate for security.authentication.rememberme.services.simplehash.$firewallName #41671

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

Closed
allan-simon opened this issue Jun 11, 2021 · 8 comments

Comments

@allan-simon
Copy link

Symfony version(s) affected:5.3.0
Description
Implementation of security.authentication.rememberme.services.simplehash.$firewallname does not exist anymore

as per https://stackoverflow.com/questions/67604938/auto-remember-me-after-register
I used this to manually trigger the remember me feature

however the service does not exist anymore , only the abstract one

in symfony 5.2

 security.authentication.rememberme.services.simplehash                                Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices                         
  security.authentication.rememberme.services.simplehash.company_admins                 Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices                         
  security.authentication.rememberme.services.simplehash.endusers                       Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices                         
  security.authentication.rememberme.services.simplehash.rosaly_admins                  Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices      

in symfony 5.3, only:

  security.authentication.rememberme.services.simplehash                                Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices                     

How to reproduce

  • create a symfony app
  • in security.yaml add
    firewalls:
        users:
            pattern: ^/
            provider: users
            remember_me:
                secret: '%kernel.secret'
                lifetime: 604800 # 1 week in seconds
                path: /
                always_remember_me: true

run console debug:container -> security.authentication.rememberme.services.simplehash.users is not present

Possible Solution

Additional context

@chalasr
Copy link
Member

chalasr commented Jun 11, 2021

Do you have the security.enable_authenticator_manager config option set to true?

@allan-simon
Copy link
Author

yes

security:
    enable_authenticator_manager: true

@norkunas
Copy link
Contributor

We had to migrate to use Symfony\Component\Security\Http\RememberMe\RememberMeHandlerInterface instead of security.authentication.rememberme.services.simplehash

@wouterj
Copy link
Member

wouterj commented Jun 11, 2021

The remember me system has be completely refactored in 5.3 for the experimental authenticator system, so this is an expected change. See #40145 for more details.

Seems like this is missing from the UPGRADE-5.3 guide. PR welcome :)

@allan-simon
Copy link
Author

I will try to read your PR but I'm affraid it will go deeper than my knowledge of symfony to provide a PR for the upgrade guide

@allan-simon
Copy link
Author

so Indead instead if I inject

RememberMeHandlerInterface $rememberMe

directly , it's autowired without needing anything on my side in services.yaml

and I can simply call

            $rememberMe->createRememberMeCookie($user);

@dompie
Copy link
Contributor

dompie commented Jun 14, 2021

Do you have the security.enable_authenticator_manager config option set to true?

This is deprecated in favor of using entry_point , isn't it?

@stof
Copy link
Member

stof commented Jun 14, 2021

@dompie this security.enable_authenticator_manager setting is the one controlling whether the new security system is used instead of the old one. It is not replaced by entry_point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants