Authenticate requests in expressjs

Viewed 13

I made an express js backend which executes a couple of GET and POST requests I would like to call from a react web app.

This works perfectly fine. The only problem I would like to solve is to give a sort of “authentication” to the requests, ensuring they are all legitimate.

I would like to avoid a user inspecting my requests through inspect elements, and later sending them through his own tools.

I thought I could generate a code on the react web app, send it through a query parameter and then verify the code in the backend. Only problem with this would be that a good enough user could read the code understanding the code generation process, despite potential obfuscation.

Thus, what would be the best approach?

Thanks

0 Answers
Related