Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Oct 22 22:09
    shadowhand labeled #112
  • Oct 22 22:09
    shadowhand locked #112
  • Oct 22 22:09
    shadowhand closed #112
  • Oct 22 22:08
    shadowhand labeled #111
  • Oct 22 22:08
    shadowhand locked #111
  • Oct 22 22:08
    shadowhand closed #111
  • Oct 22 22:05
    Brettredhatt opened #112
  • Oct 22 22:03
    Brettredhatt opened #111
  • Oct 21 15:55

    shadowhand on master


  • Aug 16 15:33
    netniV opened #110
  • Jun 04 19:00
    shadowhand closed #109
  • Jun 04 19:00
    shadowhand labeled #109
  • Jun 04 19:00
    shadowhand labeled #109
  • Jun 04 19:00
    shadowhand commented #109
  • Jun 03 17:22
    officeutils opened #109
  • May 17 18:14
    shadowhand commented #108
  • May 17 14:53

    shadowhand on master

    Added some spaces in readme cod… (compare)

  • May 17 14:53
    shadowhand closed #108
  • May 14 13:58
    wotta opened #108
  • Apr 12 12:41

    shadowhand on master

    FIX: doc for force refresh toke… (compare)

i got this error
Woody Gilk
oh hi
"error": "invalid_request",
"error_description": "Invalid parameter value for redirect_uri: Missing scheme: http%3A%2F%2Flocalhost%3A8080%2Fgoogleauth"
that "redirect_uri" is correct as can be, coz, if it wasnt (i tried some random string or a valid url i didnt register) it would NOT even show the autherisation window
from line 116
In this place i have a valid Google code "4/ehmD21nJ5CyJUdA6FHMQVXmHDtj3AbieDGQ4RaCGqaM"
and i want to replace it for a token

var postData = querystring.stringify({
"code": encodeURIComponent(code),
"client_id": encodeURIComponent("180240732797-d3guqhimhnn7e6sli1fdikqjllhj0k2p.apps.googleusercontent.com"),
"client_secret": encodeURIComponent("ZZ2cYBmKZqgBvXF9HUs1jPNhFQ"),
"redirect_uri": encodeURIComponent(redirect_uri),
"grant_type": encodeURIComponent("authorization_code")

var options = {
hostname: "www.googleapis.com",
path: '/oauth2/v4/token',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(postData)

I send the request like so (valid code)

var https_request = https.request(options, (result) => {
result.on('data', (chunk) => {
console.log(BODY: ${chunk});
result.on('end', () => {
console.log('No more data in response.');
response.redirect(302, req.session_data.referer);

https_request.on('error', (e) => {
console.log(problem with request: ${e.message});
response.send('there was a problem:' + JSON.stringify(e));

// write data to request body

can someone help?
Merlijn Vermeer
Hey I am new to auth in lumen and I can't find a guide to get the oauth2 with google working in lumen
could someone help me with that? a little guide would be nice
let me give you a tip
I made it for facebook, but its 100% same principle, no front end js code
is there chat for oauth2-facebook?
Hello everyone! I have the same problem as this guy (http://stackoverflow.com/questions/41774244/missing-information-from-google-id-token-in-php), do you have any idea of what the problem could be? Thanks in advance
How can I fix problem
Woody Gilk
@hellboy81 you need to update your settings in Google developer console to match what you are using in the package
Thanks. I have localized the problem: additional query params in redirect url (expecting provider name itself) should be JSON serialized and encoded in state params
I.e. google callback url should be as follows: index.php?fnc=redirect&provider=google
index.php?fnc=redirect&provider=google&myParamShouldBeHandledByMyOwnRedirectHandler=someValue is wrong
Chris Johnson

Getting this super, verbose, explanative error from my passport-google-oauth callback:

    at /Users/johnsoct/Dropbox/Development/squashtomato/node_modules/passport-google-oauth20/lib/strategy.js:95:21
    at passBackControl (/Users/johnsoct/Dropbox/Development/squashtomato/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage.<anonymous> (/Users/johnsoct/Dropbox/Development/squashtomato/node_modules/oauth/lib/oauth2.js:157:7)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Here is my code for it:

passport.use(new GoogleStrategy({
      clientID: process.env.GOOGLE_CONSUMER_KEY,
      clientSecret: process.env.GOOGLE_CONSUMER_SECRET,
      callbackURL: "",
      passReqToCallback: true
    function(request, accessToken, refreshToken, profile, done) {
      User.findOne({ googleId : profile.id }, function (err, user) {
        if (err) console.log(err);
        if (!err && user !== null) done(null, user);
        user = new User({
          googleId: profile.id,
          email: profile.email
        user.save(function(err) {
          if (err) console.log(err);
          console.log('saving user...');
          done(null, user);
// authcontroller.js
exports.google = passport.authenticate('google', {
  scope: 'https://www.google.com/m8/feeds'

exports.googleCallback = passport.authenticate('google', {
  failureRedirect: '/login', // if fail, where to go
  failureFlash: 'Failed Login!', // if fail, what to flash
  successRedirect: '/', // if success, where to go
  successFlash: 'You are now logged in!' // if success, what to flash

// google oauth2 - routes.js
router.get('/auth/google', authController.google);
router.get('/oauth2callback', authController.googleCallback

Any ideas?

Finn LeSueur
Does anyone have any ideas on #45? It's plaguing me a lot - no one using Android can seem to log in properly because it just shows the Chrome sync settings instead of the oauth account selection page