dreamfactorysoftware/oasys — pull request #1 by dwdunn (2014-10-03 07:00:47+00:00)
Title: Update Google Plus scopes and endpoints

Attempts at logging into the DSP using Google Plus failed on the Dreamfactory cloud offering and a local installation. Modifying the local instance's Oasys with the changes below enables logging into the local instance successfully with Google Plus with an existing DSP user.

One failure mode is due to calls to https://accounts.google.com/o/oauth2/token passing the 'state' parameter. Extending requestAccessToken in GooglePlus.php resolves that problem. Google helpfully returns the following error message:

[2014-09-28 08:45:48] app.DEBUG: token request _result toString:stdClass Object
(
[error] => invalid_request
[error_description] => Parameter not allowed for this message type: state
)

According to https://developers.google.com/+/api/auth-migration, Google's scopes have changed since the last Oasys commit to master, and getUserData uses the Google Plus /plus/v1/people/me API to convert the response to a GenericUser similar to Facebook. Once the valid user is returned, the login works.

Google Plus was also added to the test section, and the web/index.php page logs permits login through Google and displays the GenericUser Object successfully.