Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (14 sloc) 0.759 kb


I wanted to create a common interface to abstract multiple identity providers (using OAuth2 to start with) in order to provide authentication for my projects. This is the first.

var idpGoogle = require('idp-google')({ clientID: '1234', clientSecret: 'secret', 'redirectUri': '' });

// Get the auth URL to redirect the user for OAuth2 login
idpGoogle.authUrl({ state: 'session_id' });

// Using the code provided in the query string upon return to your web app, get the identity:
idpGoogle(code, function (err, identity) {
  if (err) {
  else {
    do_amazing_things_with(,, identity.url, identity.accessToken);
Jump to Line
Something went wrong with that request. Please try again.