Giter Club home page Giter Club logo

node-oauth-demo's Introduction

A very simple demo of OAuth 2.0 using Node.js,to add GitHub login to your app and access GitHub API.

This demo is slightly modified from sohamkamani's node-oauth-example. More details in his blog (English) or my blog (Chinese).

Step one: register the app

Register the app on Github : https://github.com/settings/applications/new .

Once register, you will get a client ID and a client secret.

Step two: get the code

First, clone the repo.

$ git clone [email protected]:ruanyf/node-oauth-demo.git
$ cd node-oauth-demo

Second, modify the config.

  • index.js: replace the values of the clientID and clientSecret variables.
  • public/index.html: replace the values of the client_id variable.

Third, install the dependencies.

$ npm install

Step three: run the server

Now, run the server.

$ node index.js

Visit http://localhost:8080 in your browser, and click the link to login GitHub.

node-oauth-demo's People

Contributors

ruanyf avatar sohamkamani avatar yiliang114 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.