0

I made an API for my personal use in the Flask without any database, I want to add token authentication to that API without any user Sign Up. I want, can generate a JWT and send that to the server then Server can verify that JWT is valid then send a response else give an unauthorized error. it must check when I request any endpoint of my API.

thanks in Advance.

1 Answers1

0

This is an unusual approach. Usually server generates the token and set the claims such as expiry time etc. You're talking about opposite approach where the client is generating the token which means set those claims accordingly. I'm not sure whether you're facing any technical challenge while going with standardized approach where server issue the tokens to client. The client responsibility will be to pass the token in each request and the server will validate each requests by validating the token passed in the request.

b.s
  • 2,409
  • 2
  • 16
  • 26
  • sorry, harry if my question is wrong. actually, I made an API with Flask without any authentication but I don't want anyone will be able to access those API endpoints. I can implement basic auth to Nginx but that is not much secure so I asked for secure with JWT. – Ajay Kumar Joshi Jun 29 '22 at 07:44