Can't configure refresh token with SF6
sanchobouillant opened this issue · 6 comments
Hi everyone,
I try to configure the bundle with SF6 AND php8.1
routes.yaml
gesdinet_jwt_refresh_token:
path: /auth-token/refresh
controller: gesdinet.jwtrefreshtoken::refresh
security.yaml
login:
pattern: ^/auth-token
user_checker: App\Security\UserChecker
stateless: true
json_login:
check_path: /auth-token
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
refresh:
pattern: ^/auth-token/refresh
user_checker: App\Security\UserChecker
stateless: true
refresh_jwt: ~
provider: app_user_provider
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: app_user_provider
user_checker: App\Security\UserChecker
stateless: true
jwt: ~
entry_point: jwt
With that code I have
Attempted to load class \"AbstractGuardAuthenticator\" from namespace \"Symfony\\Component\\Security\\Guard\".\nDid you forget a \"use\" statement for another namespace?
If I remove the controller part from the routes.yaml I have:
Unable to find the controller for path "/auth-token/refresh". The route is wrongly configured.
What did I missed in my configuration?
Try to remove controller:
from routes. It's non intended for usage with recent SF versions.
Also add provider
to a firewall
#307 (comment)
Whenb I remove the controller and add the provider. I have
Unable to find the controller for path \"/auth-token/refresh\". The route is wrongly configured.
security.yaml
api_token_refresh:
pattern: ^/auth-token/refresh
stateless: true
provider: app_user_provider
refresh_jwt: ~
routes.yaml
api_refresh_token:
path: /auth-token/refresh
@sanchobouillant Did you ever find a solution for this? I'm also facing the same issue.
same here
Remove config/routes/gesdinet_jwt_refresh_token.yaml
It work but there are some deprecated warning
routes.yaml:
api_login_check:
path: /auth-token
gesdinet_jwt_refresh_token:
path: /api/token/refresh
security:
login:
pattern: ^/auth-token
user_checker: App\Security\UserChecker
stateless: true
json_login:
check_path: /auth-token
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
refresh:
pattern: ^/auth-token/refresh
user_checker: App\Security\UserChecker
stateless: true
refresh_jwt: ~
provider: app_user_provider
main:
lazy: true
provider: app_user_provider
user_checker: App\Security\UserChecker
stateless: true
jwt: ~
entry_point: jwt
refresh_jwt:
check_path: gesdinet_jwt_refresh_token
gesdinet_jwt_refresh_token:
gesdinet_jwt_refresh_token:
refresh_token_class: App\Entity\RefreshToken
single_use: true