Social Auth Google 1.x - Installation instructions
Social Auth Google module depends on Google API PHP Client 2.x library and uses Composer to download it. Composer can automatically download the correct version of the SDK for you.
Overview of installation steps
- Step 1: Create a project and get credentials from https://console.developers.google.com.
- Step 2: Download Social Auth Google and Google API PHP Client using Composer.
- Step 3: Enable and configure Social Auth Google module.
Step 1: Create a project
- Create a new project on https://console.developers.google.com
- Create an OAuth Client ID credential on https://console.developers.google.com/apis/credentials and configure it
- For Authorized JavaScript origins, enter your domain (e.g. http://localhost, http://www.example.com)
- For Authorized redirect URIs, enter the full url to your drupal project + /user/login/google/callback. For example, consider that your domain is http://www.example.com but your drupal project is in http://www.example.com/drupal. In this case you should enter http://www.example.com/drupal/user/login/google/callback
Step 2: Install Social Auth Google and Google API PHP Client using Composer.
On the the command line of your server, navigate to your Drupal root directory.
Let's inform Composer that we want to use packages.drupal.org/8 as a package repository:
composer config repositories.drupal composer https://packages.drupal.org/8
Now that Composer can search packages from Drupal 8 package repository, let Composer download Social Auth Google (and all its dependencies). The following command will download the latest 8.x-1.0 release of Social Auth Google:
composer require "drupal/social_auth_google:~1.0"
If you would like to use the 8.x-1.x-dev instead, use the following command:
composer require "drupal/social_api:1.x-dev" "drupal/social_auth:1.x-dev" "drupal/social_auth_google:1.x-dev"
Social Auth Google dev versions are usually only compatible with Social Auth and Social API dev versions. The command above installs the dev branch of all these modules.
Step 3: Enable and configure Social Auth Google module
Now that Composer has downloaded the Google API PHP Client library and other dependencies, you can enable Social Auth Google.
- The module settings can be configured on /admin/config/social-api/social-auth/google
- Add your Client ID and Client Secret (from step 1) to the module settings
- You probably also want to check your Drupal account settings at /admin/config/people/accounts, making sure that visitors can create accounts
Check installation status and give it a try!
- After you have completed steps 1-3 above, verify that you can see that Composer has downloaded the Google API PHP Client library to
vendor/google
directory of your Drupal installation. - Add a Social Auth Login block to any region. If you already have added a block before installing this module and nothing is shown, try rebuilding the cache
- Click on the "Google+" logo
- Alternatively you can add a link anywhere on the site that points to user/login/google
Support requests
- Before posting a support request, carefully read the installation instructions provided on this page and do the setup in this order.
- Once you have done this, you can post a support request at module issue queue. Support requests to the issue queue, please, not to the comments on this documentation page.
- When posting a support request, please inform if you were able to see any errors in Recent log entries.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Social Auth 1.x