perrybutler / WP-OAuth

A WordPress plugin that allows users to login or register by authenticating with an existing Google, Facebook, LinkedIn, Github, Reddit or Windows Live account via OAuth 2.0. Easily drops into new or existing sites, integrates with existing users.
GNU General Public License v2.0
97 stars 76 forks source link

GitHub authentication extra #21

Open ewels opened 9 years ago

ewels commented 9 years ago

Hi there,

I just made a few changes to the GitHub authentication - mainly adding in the option to restrict access only to users who are members of a particular Organisation of choice. Also using some of the metadata returned from GitHub to make the user profile registration more complete.

Unfortunately I took the code from WordPress, used my GUI editor and then had to try to make a PR that wasn't all whitespace. It isn't perfect, hopefully it makes sense with ?w=1..

I'm happy with what we have working now, so feel free to take or leave as many of the changes as you like.

Phil

ewels commented 9 years ago

Yup, without whitespace looks better. Not sure why all of register.php is coming up as new.. Some kind of carriage return weirdness.

Phil

ewels commented 9 years ago

Just reduced the scope requested for the GitHub auth too - it was previously asking for full access, which was scaring people a little. Changing the scope from 'user' to '' (empty string) still seems to work fine, and is then read-only of public data only.