Sgnl
Sgnl

Reputation: 1970

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.

Upvotes: 5

Views: 1370

Answers (1)

jaywon
jaywon

Reputation: 8234

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

Upvotes: 9

Related Questions