Installation and Configuration

Last updated on
30 June 2020

Installation

One can follow simple steps as mentioned in Installing Drupal Modules but I recommend to use composer to install the module, specially for installing Google Api Client as that will automatically install google api php client library, for more details read this documentation

Configuration

The module adds a fieldable entity with entity type id gauth_user.  Will consider one example to explain configuration and creation of gauth_user entities.  Consider we have a website which organizes fundraiser events and we have donors database.  We want that any donor can subscribe to our events (so basically whenever a new event is organized we will create an google calendar event and that event should be shared with all subscribed users).  Admins/developers need to follow these steps:

1) Setup Google Api Client account as

For more details you can refer google api client documentaiton and google api console documentation

2) After saving above account we need to enable this account for User authentication, this can be done by Navigating to 

Manage -> Structure -> Google Authentication for Users Settings

Now you should see as 

Check the Google calendar checkbox and save configuration.  This has now enabled this google api client account for end user authentication. Just for this example we will create one new field under "Manage fields", call the field "calendar id" which will be used to save the event calendar.

3) Now we need to setup which user roles can authenticate for this account.  To configure this goto the permissions page, for testing I added "Google User" role.

4) I am giving Authenticate permission and also "View and Authenticate Google Authentication for User Api Account" permission, the first permission is enough for authenticating, the second permission is to add a tab to user page where user can see which accounts are enable for authentication, which are already created and authenticated and which can be improved.

5) Now logged in as the Google User can authenticate where in site redirects the user to google and complete authentication is now saved in the gauth_user entity.

6) Admins/Developers can view the list of gauth_user entities at admin/config/services/gauth_user

(this account is not authenticated which is why still shows the "Authenticate" link)

Configuration and end user authentication is done, next is how developers can code the desired sharing of google events, this is covered on next page.

Help improve this page

Page status: No known problems

You can: