0

I just tested symfony flex with LexikJWTAuthenticationBundle2.4, I followed here

Error is NotFoundHttpException Unable to find the controller for path "/login_check". The route is wrongly configured.

do I have to create a controller? not sure! or what is it like stupidity

this my security file:

security:
    encoders:
        App\Entity\User: 
            algorithm: bcrypt
  
    providers:
        entity_provider:
            entity:
                class: App\Entity\User
                property: username
       
        users:
            id: App\Metier\Provider\UserProvider
        
    firewalls:
        login:
            pattern:  ^/login
            stateless: true
            anonymous: true
            json_login:
                provider: users
                check_path:    /login_check
                success_handler:                  lexik_jwt_authentication.handler.authentication_success
                failure_handler:          lexik_jwt_authentication.handler.authentication_failure


        register:
            pattern:  ^/register
            stateless: true
            anonymous: true
        api:
            pattern:   ^/api
            stateless: true
            provider: entity_provider
            anonymous: false
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator

    access_control:
        - { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/personnel, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api,      roles: IS_AUTHENTICATED_FULLY }

My route.yml and My private key:

api_login_check:
        path: /login_check

 -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,1F2589373C3622EADA0262E3D18FBA51

thank you in advance for your help

Nirina-aj
  • 192
  • 1
  • 3
  • 18

1 Answers1

0

I solved my problem, because I used json_login in firewalls,so we had to do as to authenticate with postman:

{
 "username":"bla",
 "password":"blabla"
}
Nirina-aj
  • 192
  • 1
  • 3
  • 18