Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Github Auth scope #11788

Closed
abhisekp opened this issue Nov 24, 2016 · 6 comments
Closed

Invalid Github Auth scope #11788

abhisekp opened this issue Nov 24, 2016 · 6 comments
Assignees
Labels
help wanted Open for all. You do not need permission to work on these.

Comments

@abhisekp
Copy link
Member

abhisekp commented Nov 24, 2016

The github auth url is https://github.com/login?client_id=2b2a9dcc53df88ddf452&return_to=/login/oauth/authorize?client_id=2b2a9dcc53df88ddf452&redirect_uri=http://www.freecodecamp.com/auth/github/callback&response_type=code&scope=email

Here, scope=email parameter is not a valid scope according to https://developer.github.com/v3/oauth/#scopes

If it is meant to retrieve only the public data of a user, scope is not required to be given.
Or if it is meant to retrieve both public data and private email id, then scope should be set to user:email.

Currently, using an invalid scope, only public data is retrieved but not the private email id (if this was not intentional).
https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/server/passport-providers.js#L147
https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/server/passport-providers.js#L161

This was added in commit 2256f3e

@abhisekp abhisekp added accounts status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. labels Nov 24, 2016
@raisedadead
Copy link
Member

Considering that we are planning not to get email-id from GitHub soon, and just have a profile link up and sync, should we just limit this to public data scope?

Yes, that said the invalid scope needs to be rectified, still.

/cc @QuincyLarson, @BerkeleyTrue

@QuincyLarson
Copy link
Contributor

@raisedadead I agree. We can remove this scope, as and we will no longer need email addresses through GitHub anyway.

@BerkeleyTrue if we update this scope, is there any risk of losing email addresses for campers in our database?

@BerkeleyTrue
Copy link
Contributor

BerkeleyTrue commented Nov 29, 2016

@QuincyLarson no loopback will not automatically remove emails. The emails we already have will not be removed.

This scope can safely be removed.

@BerkeleyTrue BerkeleyTrue added help wanted Open for all. You do not need permission to work on these. and removed accounts status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. labels Nov 29, 2016
@QuincyLarson
Copy link
Contributor

QuincyLarson commented Nov 30, 2016

@BerkeleyTrue OK - great. Thank you for confirming this. @abhisekp since you discovered this issue, would you like to be the contributor to create the pull request?

@raisedadead
Copy link
Member

I am sure he meant you @abhisekp ! 😅

@QuincyLarson
Copy link
Contributor

@raisedadead yes, thanks for correcting me. I meant @abhisekp. I failed to scroll all the way up to the top of the issue 🙂

@BerkeleyTrue BerkeleyTrue added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Nov 30, 2016
@BerkeleyTrue BerkeleyTrue removed the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants