mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: update JWT authentication
This commit is contained in:
@@ -2,6 +2,7 @@ lexik_jwt_authentication:
|
|||||||
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
|
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
|
||||||
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
|
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
|
||||||
pass_phrase: '%env(JWT_PASSPHRASE)%'
|
pass_phrase: '%env(JWT_PASSPHRASE)%'
|
||||||
|
token_ttl: 3600 # in seconds, default is 3600
|
||||||
|
|
||||||
api_platform:
|
api_platform:
|
||||||
check_path: /api/login
|
check_path: /api/login
|
||||||
|
|||||||
@@ -13,14 +13,17 @@ security:
|
|||||||
dev:
|
dev:
|
||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||||
security: false
|
security: false
|
||||||
|
login:
|
||||||
|
pattern: ^/api/login
|
||||||
|
stateless: true
|
||||||
|
json_login:
|
||||||
|
check_path: /api/login
|
||||||
|
success_handler: lexik_jwt_authentication.handler.authentication_success
|
||||||
|
failure_handler: lexik_jwt_authentication.handler.authentication_failure
|
||||||
|
|
||||||
api:
|
api:
|
||||||
pattern: ^/api
|
pattern: ^/api
|
||||||
stateless: true
|
stateless: true
|
||||||
entry_point: jwt
|
|
||||||
json_login:
|
|
||||||
check_path: /api/login # or, if you have defined a route for your login path, the route name you used
|
|
||||||
success_handler: lexik_jwt_authentication.handler.authentication_success
|
|
||||||
failure_handler: lexik_jwt_authentication.handler.authentication_failure
|
|
||||||
jwt: ~
|
jwt: ~
|
||||||
|
|
||||||
# activate different ways to authenticate
|
# activate different ways to authenticate
|
||||||
@@ -32,8 +35,9 @@ security:
|
|||||||
# Easy way to control access for large sections of your site
|
# Easy way to control access for large sections of your site
|
||||||
# Note: Only the *first* access control that matches will be used
|
# Note: Only the *first* access control that matches will be used
|
||||||
access_control:
|
access_control:
|
||||||
- { path: ^/api/login, roles: PUBLIC_ACCESS }
|
- { path: ^/api/login$, roles: PUBLIC_ACCESS }
|
||||||
- { path: ^/api$, roles: PUBLIC_ACCESS }
|
- { path: ^/api$, roles: PUBLIC_ACCESS }
|
||||||
|
- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
|
||||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
# - { path: ^/profile, roles: ROLE_USER }
|
# - { path: ^/profile, roles: ROLE_USER }
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,6 @@ controllers:
|
|||||||
path: ../src/Controller/
|
path: ../src/Controller/
|
||||||
namespace: App\Controller
|
namespace: App\Controller
|
||||||
type: attribute
|
type: attribute
|
||||||
api_login_check:
|
|
||||||
|
api_login:
|
||||||
path: /api/login
|
path: /api/login
|
||||||
|
|||||||
Reference in New Issue
Block a user