All possible scope options in Passport for Facebook and Google
Asked Answered
M

2

5

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);
Marysa answered 22/3, 2016 at 7:3 Comment(0)
P
16

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

Pulpboard answered 23/3, 2016 at 11:27 Comment(0)
C
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.

Condition answered 27/1, 2021 at 15:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.