配置LexikJWTAuthenticationBundle时,我只需要使用以下设置设置security.yml:
security:
# ...
firewalls:
login:
pattern: ^/api/login
stateless: true
anonymous: true
form_login: # <-- my question is about this
check_path: /api/login_check
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
require_previous_session: false
api:
pattern: ^/api
stateless: true
guard:
authenticators:
- lexik_jwt_authentication.jwt_token_authenticator
access_control:
- { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
没有对数据库或用户类的引用。在发出此请求时,捆绑包如何知道如何对用户进行身份验证?
curl -X POST http://localhost:8000/api/login_check -d _username=johndoe -d _password=test
我查看了该软件包的源代码,但我找不到有关_username
的任何参考资料。这是一个Symfony内置安全系统吗?