Это старая версия документа!
Security
security.yaml
security: enable_authenticator_manager: true # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider providers: # used to reload user from session & other features (e.g. switch_user) app_user_provider: entity: class: App\Entity\User property: username firewalls: login: pattern: ^/api/login stateless: true provider: app_user_provider json_login: check_path: /api/login success_handler: lexik_jwt_authentication.handler.authentication_success failure_handler: lexik_jwt_authentication.handler.authentication_failure api: pattern: ^/api stateless: true jwt: ~ access_control: - { path: ^/$, roles: PUBLIC_ACCESS } - { path: ^/docs, roles: PUBLIC_ACCESS } - { path: ^/api/login, roles: PUBLIC_ACCESS } - { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
- app_user_provider - used to reload user from session & other features (e.g. switch_user)
config/packages/lexik_jwt_authentication.yaml
lexik_jwt_authentication: secret_key: '%env(resolve:JWT_SECRET_KEY)%' public_key: '%env(resolve:JWT_PUBLIC_KEY)%' pass_phrase: '%env(JWT_PASSPHRASE)%' token_ttl: 3600 api_platform: check_path: /login_check username_path: email password_path: password
Symfony / API Platform
2023/09/12 15:57 | linkbacks Linkbacks | symfony | ||
2024/04/14 23:41 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/15 20:27 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/15 23:30 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/16 00:55 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/15 21:01 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/15 22:07 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/14 23:52 | linkbacks Linkbacks | php, api-platform, symfony | ||
2024/04/15 20:23 | linkbacks Linkbacks | php, api-platform, symfony |