Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure scope of information I gather from Google OAuth in MeteorJS package?

Tried searching google and StackOverflow but with no luck, perhaps your knowledge of Google-OAuth can help...

I installed the base google-oauth package via meteor.

meteor add accounts-ui
meteor add accounts-google

Then I tested it out and saw that it requests the user to permit access to 2 main groups on information, the first being the user's email and the second being "basic information" about the users account, e.g. Name, Gender, Public Profile URL etc etc.

I only want the email and no other information. I tried to look for where the URI request is built in my meteor app, someurlprobablygoogle.com/scope=email&profile or whatever, but I can't seem to find it.

like image 721
Sgnl Avatar asked Mar 09 '14 01:03

Sgnl


1 Answers

To configure Google OAuth in Meteor you need to meteor add service-configuration and meteor add accounts-google.

You should be able to modify the requestPermissions setting when calling your login method like so:

Meteor.loginWithGoogle({
 requestPermissions: ['email']
}, function (err) {
  if (err)
  Session.set('errorMessage', err.reason || 'Unknown error');
});

Shooooots

like image 90
jaywon Avatar answered Nov 19 '22 02:11

jaywon