nodejs passport authentication token

后端 未结 3 1909
半阙折子戏
半阙折子戏 2020-12-04 04:40

I am writing a nodejs application that I would like to use as both a web application, as well as an API provider. Once a user is authenticated, I want to assign that user a

3条回答
  •  误落风尘
    2020-12-04 05:15

    As bnuhero mentions you don't need sessions (although that approach has its merits too). Here's a boiler-plate project that I'm starting for this: https://github.com/roblevintennis/passport-api-tokens

    Here's an alternative and easy to follow tut (but it DOES use sessions). Might be a nice cross-reference: http://scotch.io/tutorials/javascript/easy-node-authentication-setup-and-local

    And one more reference related: http://mherman.org/blog/2013/11/11/user-authentication-with-passport-dot-js/

提交回复
热议问题