Bonjour,

J'ai un petit blocage sur la configuration de ma connexion et j'aimerai bien avoir votre avis/solution svp.

Je configure actuellement mon security.yml afin d'intégrer une connexion via lexik_jwt_authentication mais dès lors que j'intègre mes options de firewalls avec les options requis conformément à la documentation de symfony
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
        api:
            pattern:   ^/api
            stateless: true
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator
J'ai le message d'erreur : Unrecognized option "guard"

C'est du symfony 6.3
Ci-joint mon fichier complet :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
security:
    # 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:
        #users_in_memory: { memory: null }
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        login:
            pattern: ^/api/login
            stateless: true
            json_login:
                check_path: /api/login_check # or api_login_check as defined in config/routes.yaml
                success_handler: lexik_jwt_authentication.handler.authentication_success
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
 
       # main:
            #lazy: true
            #provider: users_in_memory
        api:
            pattern:   ^/api
            stateless: true
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator
 
            # activate different ways to authenticate
            # https://symfony.com/doc/current/security.html#the-firewall
 
            # https://symfony.com/doc/current/security/impersonating_user.html
            # switch_user: true
Merci d'avance.