1
votes

We are trying to get the ngnix + work as an API gateway with JWT token authorization.

https://auth0.com/blog/use-nginx-plus-and-auth0-to-authenticate-api-clients/

We are following the below document , but one question is not clear , how the front end will get the JWT token , that need to be passes as -H in every request ? Logically, the ngnix should expose one api to generate tokens. How this can be achieved.

1

1 Answers

1
votes

Nginx can only validate, not generate JWT. You need to generate the JWT inside your application using the same secret key. See the Nginx blog for an example (Section "Issuing a JWT to API Clients"). In their example, they issue a JWT using shell commands but of course you can also do this with a JWT library of your choice inside your application.