You are here

README.txt in Google Auth 7

Same filename and directory in other branches
  1. 8 README.txt
  2. 7.2 README.txt
CONTENTS OF THIS FILE
---------------------

  * Summary
  * Requirements
  * Installation
  * Google Configuration
  * Configuration
  * Api functions
  * Credits


SUMMARY
-------

This module allows you to authenticate with google,
and use this authentication to carry other api requests.

This module don't have functionality of its own,
but can help you to manage accounts, authenticate with google
(i.e. get access token) and use this authentication to carry api requests.

This module allows you to enter google account details like client id,
client secret key, developer key, select google services to be enabled
and gets the OAuth2 access token from google.

The account manage page also shows a authenticate link if the account is not
authenticated and Revoke link if the account is authenticated.


REQUIREMENTS
------------
1. Libraries API - This modules depends on libraries apis module.
You can download from http://drupal.org/project/libraries
    
2. Google client library - You need to download google api php client library
from http://code.google.com/p/google-api-php-client/downloads/list


INSTALLATION
------------

1. Copy this module directory to your sites/all/modules or
   sites/SITENAME/modules directory.

2. Download the latest release of google php client library from
   https://github.com/google/google-api-php-client/releases and
   extract it in libraries folder of the site, mostly located at
   sites/all/libraries, the path is 
  'sites/all/libraries/google-api-php-client/src..'

   You may use composer to install without downloading the file which is fine.
   The final path afer installation should be 'sites/all/libraries/google-api-php-client'

   In case of normal release install it will have src folder and incase of composer it won't have that.

   Note that version 1.6 is tested and will only work with google-api-php-client 2.0.0 or later,
   version 1.3 of this module required google-api-php-client 0.6.0 and
   1.4 is tested with 1.0.5-beta release of google-api-php-client.

3. Enable the module and manage accounts at
   admin/config/services/gauth_account.

Common problems reported at https://www.drupal.org/node/2099901 show that if 
the library folder don't have proper permissions and need to flush cache after 
setting these permissions.


GOOGLE CONFIGURATION
--------------------
1. Visit https://console.developers.google.com/project
2. Create a new project with appropriate details,
   if you don't have a project created.
3. Under "Dashboard" on left sidebar click on "Use Google API" and enable the services which you want to use by clicking the links.
   i.e. Google Analytics, etc
   You can check enabled apis as a separate tab on the page.
4. Click on "Credentials" on the left sidebar.
5. If you have not created a oauth2.0 client id then create it
   with appropriate details i.e. 
     Application Type: Web Application,
     Name: Name of the application
     Authorized Redirect uri's: You can copy the uri shown when you create a google oauth account in the admin settings.
6. Copy the client id, client secret, api key
   to configuration form of the module.


CONFIGURATION
-------------
1. Configure the api accounts at admin/config/services/gauth_account.

2. You can add new account or update existing accounts.
    Specify unique name by which you can identify the account.
    Add the client id, client secret and api key from you google project page
    i.e. https://code.google.com/apis/console/
    Select services for which this account will be used eg Google Calendar, etc.

3. On save of the form it will ask for access,
   click allow access so that the account gets authenticated.

4. Ready to use this account for api access.


 API FUNCTIONS
 -------------

1. gauth_client_get(account_name)
   This function will return a Google_client object.
   You can use this client object to make api request.
   You can pass account array instead of account_name which has client_id,
   client_secret, developer_key, access_token.

2. gauth_account_load(account_name)
   This functions return a account variable which will have the client_id,
   client_secret key, developer_key, services and importantly the access_token.
   You can use these variables to make a google client object
   and make services call depending on services enabled for the account.

3. gauth_account_delete(account_name);
   This function will allow you to delete an existing managed account
   from drupal site.
   Note: No google account will be deleted.

4. gauth_account_save(account_array)
   This function will allow you to save any existing managed account or
   create a new account in drupal site. It expects an array of account as
   id if you want to update the account
   name Name of the account
   client_id Client Id of the account
   client_secret Clients secret key
   developer_key Api Key of the account
   services Array or comma(,) separated string which has a list of services.
   Names should be as "calendar,drive" refer
   function gauth_google_services_names() in the module for these names.
   Note: Account saved or created using this api will not be authenticated,
         but you will need to call authenticate_api.

5. gauth_account_authenticate(account_name)
   This function allows you to authenticate the account with google and
   get access token from google.

6. gauth_account_token_revoke(account_name)	
   This function allows you to unauthenticate the account with google
   i.e revoke access token from accessing services google.

7. gauth_account_is_authenticated(account_name)
   This function checks if the account is authenticated or not. 


CREDITS
-------

The idea came up from no module providing google oauth2 authentication.

Current Maintainer: Sadashiv Dalvi <dalvisadashiv@gmail.com>

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Summary
  4. * Requirements
  5. * Installation
  6. * Google Configuration
  7. * Configuration
  8. * Api functions
  9. * Credits
  10. SUMMARY
  11. -------
  12. This module allows you to authenticate with google,
  13. and use this authentication to carry other api requests.
  14. This module don't have functionality of its own,
  15. but can help you to manage accounts, authenticate with google
  16. (i.e. get access token) and use this authentication to carry api requests.
  17. This module allows you to enter google account details like client id,
  18. client secret key, developer key, select google services to be enabled
  19. and gets the OAuth2 access token from google.
  20. The account manage page also shows a authenticate link if the account is not
  21. authenticated and Revoke link if the account is authenticated.
  22. REQUIREMENTS
  23. ------------
  24. 1. Libraries API - This modules depends on libraries apis module.
  25. You can download from http://drupal.org/project/libraries
  26. 2. Google client library - You need to download google api php client library
  27. from http://code.google.com/p/google-api-php-client/downloads/list
  28. INSTALLATION
  29. ------------
  30. 1. Copy this module directory to your sites/all/modules or
  31. sites/SITENAME/modules directory.
  32. 2. Download the latest release of google php client library from
  33. https://github.com/google/google-api-php-client/releases and
  34. extract it in libraries folder of the site, mostly located at
  35. sites/all/libraries, the path is
  36. 'sites/all/libraries/google-api-php-client/src..'
  37. You may use composer to install without downloading the file which is fine.
  38. The final path afer installation should be 'sites/all/libraries/google-api-php-client'
  39. In case of normal release install it will have src folder and incase of composer it won't have that.
  40. Note that version 1.6 is tested and will only work with google-api-php-client 2.0.0 or later,
  41. version 1.3 of this module required google-api-php-client 0.6.0 and
  42. 1.4 is tested with 1.0.5-beta release of google-api-php-client.
  43. 3. Enable the module and manage accounts at
  44. admin/config/services/gauth_account.
  45. Common problems reported at https://www.drupal.org/node/2099901 show that if
  46. the library folder don't have proper permissions and need to flush cache after
  47. setting these permissions.
  48. GOOGLE CONFIGURATION
  49. --------------------
  50. 1. Visit https://console.developers.google.com/project
  51. 2. Create a new project with appropriate details,
  52. if you don't have a project created.
  53. 3. Under "Dashboard" on left sidebar click on "Use Google API" and enable the services which you want to use by clicking the links.
  54. i.e. Google Analytics, etc
  55. You can check enabled apis as a separate tab on the page.
  56. 4. Click on "Credentials" on the left sidebar.
  57. 5. If you have not created a oauth2.0 client id then create it
  58. with appropriate details i.e.
  59. Application Type: Web Application,
  60. Name: Name of the application
  61. Authorized Redirect uri's: You can copy the uri shown when you create a google oauth account in the admin settings.
  62. 6. Copy the client id, client secret, api key
  63. to configuration form of the module.
  64. CONFIGURATION
  65. -------------
  66. 1. Configure the api accounts at admin/config/services/gauth_account.
  67. 2. You can add new account or update existing accounts.
  68. Specify unique name by which you can identify the account.
  69. Add the client id, client secret and api key from you google project page
  70. i.e. https://code.google.com/apis/console/
  71. Select services for which this account will be used eg Google Calendar, etc.
  72. 3. On save of the form it will ask for access,
  73. click allow access so that the account gets authenticated.
  74. 4. Ready to use this account for api access.
  75. API FUNCTIONS
  76. -------------
  77. 1. gauth_client_get(account_name)
  78. This function will return a Google_client object.
  79. You can use this client object to make api request.
  80. You can pass account array instead of account_name which has client_id,
  81. client_secret, developer_key, access_token.
  82. 2. gauth_account_load(account_name)
  83. This functions return a account variable which will have the client_id,
  84. client_secret key, developer_key, services and importantly the access_token.
  85. You can use these variables to make a google client object
  86. and make services call depending on services enabled for the account.
  87. 3. gauth_account_delete(account_name);
  88. This function will allow you to delete an existing managed account
  89. from drupal site.
  90. Note: No google account will be deleted.
  91. 4. gauth_account_save(account_array)
  92. This function will allow you to save any existing managed account or
  93. create a new account in drupal site. It expects an array of account as
  94. id if you want to update the account
  95. name Name of the account
  96. client_id Client Id of the account
  97. client_secret Clients secret key
  98. developer_key Api Key of the account
  99. services Array or comma(,) separated string which has a list of services.
  100. Names should be as "calendar,drive" refer
  101. function gauth_google_services_names() in the module for these names.
  102. Note: Account saved or created using this api will not be authenticated,
  103. but you will need to call authenticate_api.
  104. 5. gauth_account_authenticate(account_name)
  105. This function allows you to authenticate the account with google and
  106. get access token from google.
  107. 6. gauth_account_token_revoke(account_name)
  108. This function allows you to unauthenticate the account with google
  109. i.e revoke access token from accessing services google.
  110. 7. gauth_account_is_authenticated(account_name)
  111. This function checks if the account is authenticated or not.
  112. CREDITS
  113. -------
  114. The idea came up from no module providing google oauth2 authentication.
  115. Current Maintainer: Sadashiv Dalvi