json-HB / github-oauth-login

github OAuth login demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Online demo

haibo.online

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 https://github.com/json-HB/githun-oauth-login.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.

About

github OAuth login demo


Languages

Language:JavaScript 55.1%Language:HTML 44.9%