-1

How can I log out active session of banned user with Symfony?

This is not working

security:
    always_authenticate_before_granting: true

this is error

 The security option "always_authenticate_before_granting" cannot be used when "enable_authenticator_manager" is set to true. If you rely on this behavior, set it to false
Sinan Tosun
  • 29
  • 1
  • 6

2 Answers2

0

Try below code :

# config/packages/security.yaml
security:
    # ...
    enable_authenticator_manager: falstr
  • not working `Invalid type for path "security.enable_authenticator_manager". Expected "bool", but got "string". Hint: Enables the new Symfony Security system based on Authenticators, all used authenticators must support this before enabling this.` – Sinan Tosun Nov 06 '22 at 10:22
0

It should be:

# config/packages/security.yaml

security:
    always_authenticate_before_granting: true
    enable_authenticator_manager: false

Nilesh's answer is right but there is a typo.

kgsensei
  • 21
  • 1
  • 6
  • `Custom authenticators are not supported when "security.enable_authenticator_manager" is not set to true.` not working – Sinan Tosun Nov 12 '22 at 21:16
  • 1
    The user should be automatically logged out when the authentication token changes, a good way to do this is with roles. Based on the user banned value in your database change that users role in your user entity file. This should cause a logout. – kgsensei Nov 13 '22 at 22:48