oautha
v0.0.58
Published
Readme for OAA, a new way to setup O-Authentication.
Downloads
6
Readme
Readme for OAA, a new way to setup O-Authentication.
All of the websites that matter are supported fully. Simply call oautha as middleware and let it handle the rest.
Here is an Express server example:
1. Setup a button to send a get request to '/githublogin'
2. Run oautha.githubLogin(clientID, scopes) - see the docs for specific inputs needed for each individual o-auth process.
2a. This will send your user right to the official github login page where they can login.
2b. Once they're done they will be sent back to the redirect url that you gave to github.
3. In your middleware for the redirect url you can then use oautha.githubToken(clientId, clientSecret, userAgent)
3a. If you check your console you will see that res.locals.githubData now contains the data you asked for
3b. Feel free to do whatever you want with it after.
Code:
app.get('/githublogin', githubController.githubLogin(CLIENT_ID, ['user', 'public_repo']), (req, res, next) => {
console.log('github oauth running');
});