这是我的security.yml文件
login:
pattern: ^/login
anonymous: ~
security: true
main:
pattern: ^/
anonymous: ~
security: true
form_login:
login_path: login
check_path: login_check
username_parameter: username
password_parameter: password
post_only: true
always_use_default_target_path: true
default_target_path: root
logout:
path: logout
target: login
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY,methods: [GET] }
- { path: ^/login_check, roles: IS_AUTHENTICATED_ANONYMOUSLY,methods:[POST] }
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
登录后,始终重定向到登录页面。请帮我。请参阅下面的图片以获取我的登录凭证
答案 0 :(得分:0)
必须对两个防火墙使用相同的上下文,因为我使用了两个防火墙
login:
pattern: ^/login
anonymous: ~
security: true
context: my_context
main:
pattern: ^/
anonymous: ~
security: true
......
context: my_context