Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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

    (compare)

  • 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)

Woody Gilk
@shadowhand
?
jacobus-brogly
@jacobus-brogly
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
jacobus-brogly
@jacobus-brogly

´´´javascript
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.setEncoding('utf8');
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);
response.end();
});
});

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
https_request.write(postData);
https_request.end();
´´´

can someone help?
Merlijn Vermeer
@Merlijnv
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
jacobus-brogly
@jacobus-brogly
let me give you a tip
I made it for facebook, but its 100% same principle, no front end js code
hellboy81
@hellboy81
hi
is there chat for oauth2-facebook?
Melegga
@Melegga
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
hellboy81
@hellboy81
How can I fix problem
redirect_uri_mismatch
Woody Gilk
@shadowhand
@hellboy81 you need to update your settings in Google developer console to match what you are using in the package
hellboy81
@hellboy81
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
@Johnsoct

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

Error
    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: "http://127.0.0.1:21015/oauth2callback",
      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
@finnito
Hi!
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