Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: OAuth 2 Google service.

OAuth 2 Google service: Difference between revisions

From MoodleDocs
(instructions copied from https://docs.moodle.org/dev/OAuth2_Services_Setup_Project_In_Google)
 
(OAuth2 template)
Line 1: Line 1:
{{OAuth2}}
=== Setup Project In Google ===
=== Setup Project In Google ===



Revision as of 13:59, 25 April 2017

Setup Project In Google

To setup an OAuth 2 client with Google, first we need to login to the Google Developers Console and create a new project.

Create a new project using the menu at the top of the page.

Create new project

Call the new project whatever you like, this name is not shown to users when they are asked to authorise this application.

Name the project

Select "credentials" from the menu on the left.

Switch to credentials page

Setup the consent screen for your application. This is where you provide the public information that is shown to users when they are asked to authorise your application. Setting a product name is the minimum information that is required, but the more information you provide here - the more confidence users will have when granting this authorisation.

Setup consent screen

Now you can create some client credentials. Switch to the credentials tab and create a new OAuth client ID.

Create an OAuth Client ID

Setup the credentials for a Web Application. The most important setting here is to set the callback URL. This must be set to "your moodle site url + /admin/oauth2callback.php". If your moodle site was accessible at https://lemon.edu/ then this callback URL should be set to https://lemon.edu/admin/oauth2callback.php

Set the callback URL

When you have saved the information on this page, Google will give you the client ID and client secret that you need to enter into Moodle.

Got my secrets!

Finally we have to enable the Drive API (if we want to use the google drive repository or file converter plugins).

View the Library tab
Select Drive API
Enable the API