我有"login_check"的问题,我使用Symfony 3和LexikJWTAuthenticationBundle.
问题 :
security.yml:
firewalls:
login:
pattern: ^/api/login
stateless: true
anonymous: true
form_login:
username_parameter: username
password_parameter: password
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
main:
anonymous: true
access_control:
- {path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- {path: ^/api, roles: IS_AUTHENTICATED_FULLY }
Run Code Online (Sandbox Code Playgroud)
routing.yml:
app:
resource: '@AppBundle/Controller/'
type: rest
prefix: /api
Run Code Online (Sandbox Code Playgroud)
login_check:path:api/login_check
你能帮我吗?
美好的一天 :)
使用以下命令更改您的路由文件:
app:
resource: '@AppBundle/Controller/'
type: rest
prefix: /api
api_login_check:
path: /api/login_check
Run Code Online (Sandbox Code Playgroud)