4

I am unable to locate all possible scope options in passport for facebook and google. Could anyone mention all possible scope option/values that we could pass during authentication for facebook and google?

I need to use other scope options for facebook and google just like I am currently using 'email' scope values. Please mention all possible scope options for facebook and google seperately.

passport.authenticate(key, {scope: ['email']})(req, res, next);
Abhinav Saini
  • 288
  • 4
  • 16

2 Answers2

15

As the Passport documentation states, "Values for the scope option are provider-specific. Consult the provider's documentation for details regarding supported scopes." A list of facebook scope options can be found here and google scopes here

1

I think that you may be confused by just email in {scope: ['email']}. This is the same as {scope: ['https://www.googleapis.com/auth/userinfo.email']}.

Here are all the scopes for google. To access a scope that you want, find the url in the docs and set it when you are calling:

passport.authenticate(key, {scope: ['YOUR DESIRED SCOPE URL']})(req, res, next);

I haven't used passport for Facebook OAuth but it should be something similar.