Note: You are currently viewing documentation for Moodle 2.8. Up-to-date documentation for the latest stable version of Moodle may be available here: Google OAuth 2.0 setup.

Google OAuth 2.0 setup: Difference between revisions

From MoodleDocs
(image positioning, template, categories)
(links, rewording)
Line 1: Line 1:
{{Repositories}}
{{Repositories}}
''Note: This page contains information for site administrators.''
==OAuth 2.0==
==OAuth 2.0==


Prior to Moodle 2.3, Google Docs and Picasa repository plugins and portfolio plugins could be used without any configuration or registration with Google. In April 2012, [http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html Google announced] to web application developers that they would be deprecating the service which Moodle was using to communicate with Google and strongly advised developers to move away from it. As a response to this change with Google's service, Moodle switched to use a new system for communicating with Google called 'OAuth 2.0'. The OAuth 2.0 system provides a better security system and more friendly experience to Moodle users, though it requires some additional configuration in Moodle.
Prior to Moodle 2.3, the [[Google Docs repository]] and [[Picasa web album repository]] and the [[Google Docs portfolio]] and [[Picasa portfolio]] could be used without any configuration or registration with Google. In April 2012, [http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html Google announced] to web application developers that they would be deprecating the service which Moodle was using to communicate with Google and strongly advised developers to move away from it. As a response to this change with Google's service, Moodle switched to use a new system for communicating with Google called 'OAuth 2.0'. The OAuth 2.0 system provides a better security system and more friendly experience to Moodle users, though it requires some additional configuration in Moodle.


==Registering with Google==
==Registering with Google==
Each Moodle site now needs to be registered with Google in order to use the Google Docs or Picasa plugins. The following will guide you through the process of registering with Google.
Each Moodle site now needs to be registered with Google in order to use the Google Docs or Picasa plugins. The following will guide you through the process of registering with Google.


# You will need to be signed into a google account
# Visit the [https://code.google.com/apis/console#access Google APIs Console] and sign into your google account. You will be asked to create a project if this is your first time using this form.
# Visit the Google API's Console https://code.google.com/apis/console#access
# Click the button 'Create an OAuth 2.0 client ID'
# You will be asked to create a project if this is your first time using this form.
# Enter the branding information 'Product name' (i.e. the name of your Moodle site) and 'Product logo' (i.e. your site logo). By providing a descriptive name and link to distinct image then your users will know they are signing into the correct place.  
# You need to click the button marked 'Create an OAuth 2.0 client ID..'
# Click the Next button
# You will be asked to enter branding information including a 'Product name' and 'Product logo'. By providing a descriptive name and link to distinct image then your users will know they are signing into the correct place.  
# In 'Client ID Settings' select 'Web application' as application type.
# Next you will be asked for 'Client ID Settings'  
# Click the '(more options)' link next to 'Your site or hostname' then in 'Authorized Redirect URIs' enter the URL which was provided in your Moodle settings page (usually <nowiki>http://yourmoodle/admin/oauth2callback.php</nowiki>) and leave the 'Authorized JavaScript Origins' field blank
## For Application type, select 'Web application'
# Click the button 'Create client ID'
## Next to 'Your site or hostname' click '(more options)'
 
## In 'Authorized Redirect URIs' enter the URL which was provided in your Moodle settings page. (usually http://yourmoodle/admin/oauth2callback.php)
Your site will then be registered with Google and you will be presented with your details.
## In 'Authorized JavaScript Origins' leave the field blank
# Click 'Create client ID'
# Your site is now registered with Google and you will be presented with your details.
# Enter the 'Client ID' and 'Client secret' provided into your Moodle settings page


:8. Enter the 'Client ID' and 'Client secret' provided into your Moodle settings page


<gallery perrow=3 caption="Registering with Google - click on any to enlarge">
Once configured, Google will present Moodle users with a nice authorisation screen with your Moodle site name and logo for your users to authorise.
Image:google_oauth1.png|3. Creating API Project
File:google_oauth2.png|4. Creating an OAuth 2.0 Client ID
File:google_oauth2.png|4. Creating an OAuth 2.0 Client ID
File:google_oauth3.png|5. Client Settings
File:google_oauth4.png|9. Callback options
File:google_oauth5.png|12. Registered details
</gallery >


Once configured, Google will present Moodle users with a nice authorisation screen with your moodle name and logo for your users to authorise:


[[File:google_oauth6.png|thumb|left|Authorisation screen]]
<gallery perrow=3 caption="Registering with Google - click on each to enlarge">
Image:google_oauth1.png|1. Create project
File:google_oauth2.png|2. Creating an OAuth 2.0 Client ID
File:google_oauth3.png|3. Branding information
File:google_oauth4.png|6. Client ID settings
File:google_oauth5.png|Registered details
File:google_oauth6.png|Authorisation screen
</gallery >


[[Category:Portfolios]]
[[Category:Portfolios]]
[[Category:Site administration]]
[[Category:Site administration]]

Revision as of 10:32, 13 June 2012

Note: This page contains information for site administrators.

OAuth 2.0

Prior to Moodle 2.3, the Google Docs repository and Picasa web album repository and the Google Docs portfolio and Picasa portfolio could be used without any configuration or registration with Google. In April 2012, Google announced to web application developers that they would be deprecating the service which Moodle was using to communicate with Google and strongly advised developers to move away from it. As a response to this change with Google's service, Moodle switched to use a new system for communicating with Google called 'OAuth 2.0'. The OAuth 2.0 system provides a better security system and more friendly experience to Moodle users, though it requires some additional configuration in Moodle.

Registering with Google

Each Moodle site now needs to be registered with Google in order to use the Google Docs or Picasa plugins. The following will guide you through the process of registering with Google.

  1. Visit the Google APIs Console and sign into your google account. You will be asked to create a project if this is your first time using this form.
  2. Click the button 'Create an OAuth 2.0 client ID'
  3. Enter the branding information 'Product name' (i.e. the name of your Moodle site) and 'Product logo' (i.e. your site logo). By providing a descriptive name and link to distinct image then your users will know they are signing into the correct place.
  4. Click the Next button
  5. In 'Client ID Settings' select 'Web application' as application type.
  6. Click the '(more options)' link next to 'Your site or hostname' then in 'Authorized Redirect URIs' enter the URL which was provided in your Moodle settings page (usually http://yourmoodle/admin/oauth2callback.php) and leave the 'Authorized JavaScript Origins' field blank
  7. Click the button 'Create client ID'

Your site will then be registered with Google and you will be presented with your details.

8. Enter the 'Client ID' and 'Client secret' provided into your Moodle settings page

Once configured, Google will present Moodle users with a nice authorisation screen with your Moodle site name and logo for your users to authorise.