title: How to use different authenticators for API and admin of the site
body: <p>I made a project that is divided into two parts, the front-end part using Vue.js and the back-end part using Symfony and API platform. I did an authentication system on my API platform with JWT tokens like this: <a href="https://api-platform.com/docs/core/jwt/" rel="nofollow noreferrer">https://api-platform.com/docs/core/jwt/</a> which works like a charm when using it with Vue.js and Axios library.</p>
  <p>However, I would like to use the Symfony auth component to create an admin access on my project Symfony, just to allow the admin to create new things and save them in my db. The route will be /admin/whatever. In my security.yaml, I already have a firewall for the API/JWT authentication which looks like this:<br />
  <a href="https://i.stack.imgur.com/xYCG7.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>How can I use another which handles the &quot;classic&quot; authentication of Symfony so I can have 2 authentication systems independent on each other?</p>
  <p>Edit : I tried this :</p>
  <pre><code>firewalls:
          dev:
              pattern: ^/(_(profiler|wdt)|css|images|js)/
              security: false
          login:
              lazy: true
              provider: app_user_provider
              json_login:
                  check_path: /authentication_token
                  username_path: email
                  password_path: password
                  success_handler: lexik_jwt_authentication.handler.authentication_success
                  failure_handler: lexik_jwt_authentication.handler.authentication_failure
              jwt: ~
          main:
              lazy: true
              provider: app_user_provider
              custom_authenticator: App\Security\LoginAuthenticator
              logout:
                  path: app_logout
  </code></pre>
  <p>With this access control :</p>
  <pre><code>access_control:
           - { path: ^/admin, roles: ROLE_ADMIN }
           - { path: ^/profil, roles: ROLE_USER }
           - { path: ^/authentication_token, roles: PUBLIC_ACCESS }
           - { path: ^/api/, roles: IS_AUTHENTICATED_FULLY }
  </code></pre>
  <p>But my /profil route displays this <a href="https://i.stack.imgur.com/Y345Y.png" rel="nofollow noreferrer">capture</a>
  My authentication to the api with token while doing a request still works though</p>