Social Auth Google allows users to register and login to a Drupal site with their Google account. It is based on Social Auth and Social API. This module adds a path user/login/google which redirects the user to Google Accounts for authentication.

Login process can be initiated from the "Google" button in the Social Auth block. Alternatively, site builders can place (and theme) a link to user/login/google wherever on the site.

Site administrators can configure their Client ID and Client Secret in the settings form

There is an installation guide at https://www.drupal.org/node/2764227

Link to project sandbox: https://www.drupal.org/sandbox/gvso/2763739

Clone URL::
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/gvso/2763739.git social_auth_google

CommentFileSizeAuthor
settings_form.png32.37 KBgvso
social_auth_block.png3.99 KBgvso

Comments

gvso created an issue. See original summary.

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxgvso2763739git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

gvso’s picture

Status: Needs work » Needs review

Code updated

visabhishek’s picture

Issue summary: View changes
visabhishek’s picture

Issue summary: View changes
visabhishek’s picture

Status: Needs review » Needs work

Automated Review

Issues reported by PAReview.sh:
http://pareview.sh/pareview/httpsgitdrupalorgsandboxgvso2763739git

Please fix above issues.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. (*) IN class GoogleAuthController following statements are using assignment operator instead of comparison operator.
  2.    if ($user = $this->googleManager->getUserInfo()) {
        if ($drupal_user = $this->userManager->loadUserByProperty('mail', $user->getEmail())) {
        if ($drupal_user = $this->userManager->createUser($user->getName(), $user->getEmail())) {
  3. (+) Please use 4 space indenting in composer.json

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

gvso’s picture

Thanks for reviewing the code!

I have updated it with commits c246505 and f223fe.

The warning from PAReview.sh states:

112 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead

However, that line uses $this->t() as the warning suggests

drupal_set_message($this->t('You could not be authenticated, please contact the administrator'), 'error');

gvso’s picture

Status: Needs work » Needs review
gvso’s picture

Last output from pareview.sh states

FILE: /root/repos/pareviewsh/pareview_temp/src/GoogleAuthManager.php
--------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------
38 | ERROR | [x] Expected "Google_Service_Oauth" but found
| | "Google_Service_Oauth2" for @var tag in member variable
| | comment
97 | ERROR | [x] Expected "\Google_Service_Oauth_Userinfoplus" but found
| | "\Google_Service_Oauth2_Userinfoplus" for function
| | return type

I'm not able to replicate this error on my local installation of pareview and the errors don't make any sense. It seems that the number "2" in the classes' names is causing the issue detected by pareview

nikathone’s picture

Status: Needs review » Reviewed & tested by the community

Tested with the current dev of drupal.org/project/social_auth

hussainweb’s picture

+1 to RTBC. I have been using this module without any issues, and the bugs I did find were fixed.

sriharsha.uppuluri’s picture

The module works as expected. I have seen a issue that when a user clicks on google signin, everytime its creating a new user account. If a user is already created with the same mailid it should take that userid and login to the system.

gvso’s picture

@sriharsha.uppuluri, maybe the bug you found is because of #2847914: Attempts to create an user even if it already exists, which is being fixed at #2848144: Create authenticate method

visabhishek’s picture

Status: Reviewed & tested by the community » Fixed

Review of the 8.x-1.x branch (commit dc61558):

Please fix the issue reported on https://pareview.sh/node/684

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

Please use get_t() in install file hook__requirements

  if ($phase == 'install') {
    if (!class_exists('\Google_Client')) {
      $requirements['social_auth_google'] = [
        'description' => t('Social Auth Google requires Google API PHP Client. Make sure the library is installed via Composer. Check README.txt for installation instructions.'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }

as

$t = get_t();
  if ($phase == 'install') {
    if (!class_exists('\Google_Client')) {
      $requirements['social_auth_google'] = [
        'description' => $t('Social Auth Google requires Google API PHP Client. Make sure the library is installed via Composer. Check README.txt for installation instructions.'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }

Otherwise all looks good for me.

Thanks for your contribution, gvso!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

gvso’s picture

Thanks @visabhishek!

It seems the error reported by pareview.sh is caused by the number 2 in the returning class name, and since it's a third party library, I can't update it. (It actually seems to be a bug in coder).

AFAIK, get_t() was removed long ago

klausi’s picture

Assigning issue credits.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.