D
D
Denis Denis2015-09-26 11:31:25
Node.js
Denis Denis, 2015-09-26 11:31:25

How to make user authorization using Authorization header in node.js?

Hello!
As I understand. When the client accesses the server for the first time, we send him the generated token, which we save in the session. On each request, the client sends the same token in the Authorization header. On the server, we check if the token from the header matches the token from the session.
Please tell me, is this how it works?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Tolerant, 2015-09-27
@mres

I would use https://www.npmjs.com/package/passport-http-bearer
Usage example: https://github.com/passport/express-4.x-http-beare...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question