S
S
Sveratum2014-07-12 19:40:14
Node.js
Sveratum, 2014-07-12 19:40:14

How to make authorization in Node.js by certificates?

Good afternoon!
Instead of a login and password, you need to use certificates to enter the site, how can this be implemented in Noed.js?
This is the authentication model I need.
Now I have a data storage model. I have a mongodb collection with document {user: 'user1', pub_key: 'ssh-rsa AAAAB3N4CLb/Qb6Rzh34GYFKJGHK+4343wHGUlblfggUJUUUUYw+Bv2zorsPYTYTgsdsfdfsdfs433414X' } , how can I do key validation?
I am using express.
When entering the resource, request the username and location of the private key, compare it with the public key from the database, if the certificate has a password, then request it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Starkov, 2014-07-13
@icelaba

Here is the article nategood.com/nodejs-ssl-client-cert-auth-api-rest
There is also a link in the article on how to set up nginx, and the node can be placed behind it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question