A
A
Anton Ulanov2016-02-13 23:27:19
Node.js
Anton Ulanov, 2016-02-13 23:27:19

How to implement authorization in nodejs for Rest Api?

Good time of the day. How to properly organize an authorization system for a self-written REST Api? I would like it to be easy and reliable :) I store the data in mongodb, but it can be stored elsewhere, since at the initial stage there will be no more than 20 users

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2016-02-14
@superD

Use passport.js:
passportjs.org

A
Anton Ulanov, 2016-02-14
@antonsr98

Thanks for the hint, I already stumbled upon the passport myself :) but now I'm tormented by another question. Is it possible to separate authorization in api and backend? Or do you need one model to work for all routes?
how I imagine it
/api/auth (token based auth)
/backend/auth (user pass) (aka system admin panel)

N
Nikita, 2014-10-23
@Rema1ns

implemented on the slider, Klookva.ru
stephband.info/jparallax

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question