Skip to content

consulate/consulate-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

consulate-github

GitHub exchange plugin for consulate.

consulate-github allows users to login/register with GitHub and exchange a GitHub access_token for a consulate authorization code.

Usage

Just register consulate-github as a plugin with your consulate server:

var consulate = require('consulate');
var github = require('consulate-github');

var app = consulate();

app.plugin(github({
  clientID: 'MY_GITHUB_CLIENT_ID',
  clientSecret: 'MY_GITHUB_CLIENT_SECRET',
  callbackURL: 'MY_GITHUB_CALLBACK_URL'
}, function(accessToken, refreshToken, profile, done) {

  // lookup user by github id here. if they don't exist create them
  ...

  // Return the user for your consulate system
  done(null, myUser);
}));

Tests

$ npm test

About

GitHub exchange plugin for consulate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published