microauth-gituhb
Github oauth for micro
Add github authentication to your micro in few lines of code. This module is a part of microauth collection.
Installation
npm install --save microauth-github# or yarn add microauth-github
Usage
app.js
const send = ;const microAuthGithub = ; const options = clientId: 'CLIENT_ID' clientSecret: 'CLIENT_SECRET' callbackUrl: 'http://localhost:3000/auth/github/callback' path: '/auth/github' scope: 'user'; const githubAuth = ; // third `auth` argument will provide error or result of authentication// so it will { err: errorObject } or { result: {// provider: 'github',// accessToken: 'blahblah',// info: userInfo// }}moduleexports = ;
Run:
micro app.js
Now visit http://localhost:3000/auth/github
Alternatives
Also you can see micro-github. This is ready for deploy microservice from @mxstbr