Note: You are currently viewing documentation for Moodle 2.4. 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
(slightly improved the initial sentence so it sounds less like I was smoking something whilst authoring it. ;-))
(Converting to thumnails. This view still sucks though. I'm not a mediawiki guru.)
Line 6: Line 6:
# You will need to be signed into a google account
# You will need to be signed into a google account
# Visit the [Google API's Console https://code.google.com/apis/console#access]
# Visit the [Google API's Console https://code.google.com/apis/console#access]
# You will be asked to create a project if this is your first time using this form. [[File:google_oauth1.png]]
# You will be asked to create a project if this is your first time using this form. [[Image:google_oauth1.png|thumb|3. creating API Project]]  
# You need to click the button marked 'Create an OAuth 2.0 client ID..' [[File:google_oauth2.png]]
# You need to click the button marked 'Create an OAuth 2.0 client ID..' [[File:google_oauth2.png|thumb|4. creating an OAuth 2.0 Client ID]]
# 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. [[File:google_oauth3.png]]
# 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. [[File:google_oauth3.png|thumb|5. client Settings]]
# Next you will be asked for 'Client ID Settings'  
# Next you will be asked for 'Client ID Settings'  
## For Application type, select 'Web application'
## For Application type, select 'Web application'
## Next to 'Your site or hostname' click '(more options)'
## 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)
## In 'Authorized Redirect URIs' enter the URL which was provided in your Moodle settings page. (usually http://yourmoodle/admin/oauth2callback.php)
## In 'Authorized JavaScript Origins' leave the field blank [[File:google_oauth4.png]]
## In 'Authorized JavaScript Origins' leave the field blank [[File:google_oauth4.png|thumb|9. callback options]]
# Click 'Create client ID'
# Click 'Create client ID'
# Your site is now registered with Google and you will be presented with your details. [[File:google_oauth5.png]]
# Your site is now registered with Google and you will be presented with your details. [[File:google_oauth5.png|thumb|12. registered details]]
# Enter the 'Client ID' and 'Client secret' provided into your Moodle settings page
# Enter the 'Client ID' and 'Client secret' provided into your Moodle settings page



Revision as of 06:26, 7 June 2012

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, 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 providers and 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. You will need to be signed into a google account
  2. Visit the [Google API's Console https://code.google.com/apis/console#access]
  3. You will be asked to create a project if this is your first time using this form.
    3. creating API Project
  4. You need to click the button marked 'Create an OAuth 2.0 client ID..'
    4. creating an OAuth 2.0 Client ID
  5. 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.
    5. client Settings
  6. Next you will be asked for 'Client ID Settings'
    1. For Application type, select 'Web application'
    2. Next to 'Your site or hostname' click '(more options)'
    3. In 'Authorized Redirect URIs' enter the URL which was provided in your Moodle settings page. (usually http://yourmoodle/admin/oauth2callback.php)
    4. In 'Authorized JavaScript Origins' leave the field blank
      9. callback options
  7. Click 'Create client ID'
  8. Your site is now registered with Google and you will be presented with your details.
    12. registered details
  9. Enter the 'Client ID' and 'Client secret' provided into your Moodle settings page

Resulting Authorisation Screen

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