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

Register using identity claims #45

Open ziogaschr opened 8 years ago

ziogaschr commented 8 years ago

This PR allows identity info to be used for profile registration.

It can be used for fixing issues #5 and #14

Sorry for doing 3 commits, but I had hard time on fixing the line endings and the whole file was being parsed as a single line. If you can advice me on how to work around, I am happy to make a new PR.

The actual code changes are at lines 42-72.

Another PR will follow showing how this can be used, although here is some example code for anyone interested which can be used in get_oauth_identity():

if(isset($result_obj['name'])){
    $oauth_identity['username'] = strtolower($result_obj['name']); //PROVIDER SPECIFIC: this is how Authentiq returns the name address
  }