I have this problem, I changed the place of the logout configuration in the firewall but always the same response, what should I do ?
I get this error :
You must activate the logout in your security firewall configuration
This is my code
security:
firewalls:
oauth_authorize:
pattern: ^/oauth/v2/auth
form_login:
provider: fos_userbundle
check_path: _security_check
login_path: _demo_login
oauth_token:
pattern: ^/oauth/v2/token
security: false
api:
pattern: ^/api
fos_oauth: true
stateless: true
anonymous: false # can be omitted as its default value
login:
pattern: ^/secured/login$
security: false
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
always_use_default_target_path: true
default_target_path: /profile
logout:
path: /user/logout
anonymous: true
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
admin:
pattern: /admin(.*)
context: user
form_login:
provider: fos_userbundle
login_path: /admin/login
use_forward: false
check_path: /admin/login_check
failure_path: null
logout:
path: /admin/logout
anonymous: true
main:
pattern: .*
context: user
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: /login_check
failure_path: null
logout: true
anonymous: true
I found the solution for this problem and it works , the problem was in the main configuration
main:
pattern: ^/
security: true
switch_user: true
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
default_target_path: /profile
anonymous: true
logout:
path: /logout
target: /login
invalidate_session: true