A simple Node.js app that gets the 3-legged oAuth token from GitHub. Unfortunately, all Github apps need server-side functionality to prevent forged logins from other sites, so you can't make your Github app browser-only.
git clone [email protected]:shiya/github-login.git- rename
example.envto.env - Go to Github->Settings->'Developer settings'->OAuth Apps and create an OAuth app.
- Set Homepage URL to
http://localhost:3000/ - Set callback URL to
http://localhost:3000/redirect - Create a client secret and save it along with the client ID in your .env file.
- Set Homepage URL to
npm installnpm start- Go to http://localhost:3000 and sign in.
If you want to test sign-in again, you will need to sign out. Github->Settings->Applications->'Authorized OAuth Apps', find your app and revoke permissions.