简体   繁体   中英

Create a RESTful web service with oauth using Node.js

I want to create a RESTful webs ervice with OAuth by Node.js, but I don't know where to start with.

I mean I want to make my own server (something like Google or Facebook does). For example: you make an App, when your App wants to get some Facebook user's resources or authorization, it has to send to Facebook a request_token and then gets back an access_token. Then I create another client to get request_token and access_token from the server I have created before.

Maybe my question gets some mistake because I'm new to this topic. Hope someone understand my problem.

You need a lot to read before start your own restful server, take a loot at this answer for theory about api servers.

An then you would see with tools/package fill your needs, maybe you can take a look at those:

  • node-oauth2-provider : Provides the authorization process just like facebook when an app ask you for permissions to access your data.
  • express : web application framework.
  • mongoose : Will help you with the schema validations / queryes, etc, also if you want a less complete solution, see mongolian
  • Try to figure out the collections you will need at least those collections, applications, users, data (or the main collections where you would store the data, also this can be products, posts, etc).

Updated 2012-12-28

Take a look at actionHero , is a node.js API framework for both tcp sockets, web sockets, and http clients. The goals of actionHero are to create an easy-to-use toolkit for making reusable and scalable APIs. actionHero provides cluster support, shared cache, integrated delayed processing, and more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM