S
S
Steve2021-03-26 16:36:54
symfony
Steve, 2021-03-26 16:36:54

Authorization with .env?

I am using NelmioDocApi. Created a variable in .env with api key MY_API_KEY=c4c-ed96_GW42bYZbea6-6daK7bCRb
My firewall authorizes users by token:

main:
            pattern:   ^/
            stateless: true
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator
            provider: user_provider

You need to authorize users from two different areas, for example /api/ and /api/login

  • /api/ must use authorization via JWT
  • /api/login - should authorize users by api key specified in .envMY_API_KEY=c4c-ed96_GW42bYZbea6-6daK7bCRb


But there is this form. 605de2bf49b72154034220.png
Is it really possible to use it for /api/login authorization through the api key specified in .env?

Which direction to look? Advise the docks, I will be even more glad for a spacious answer)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question