OAuth 2 Google service: Difference between revisions
Mary Cooch (talk | contribs) (updating this page) |
|||
Line 10: | Line 10: | ||
==OAuth 2 Google service setup== | ==OAuth 2 Google service setup== | ||
To set up an OAuth 2 client with Google, | To set up an OAuth 2 client with Google, log in to the [https://console.developers.google.com/ Google Developers Console] and click the arrow by 'Select a project'. | ||
[[File:SelectAProject.png]] | |||
Click 'Create a new project' | |||
[[File:New project.png]] | |||
Give it a name. The name is not visible to anyone so you can choose any name you like. | |||
[[File:google-2-create-new-modal.png|none|frame|Name the project]] | [[File:google-2-create-new-modal.png|none|frame|Name the project]] |
Revision as of 12:09, 18 January 2021
Features requiring the OAuth 2 Google service
You will need to set up an OAuth 2 Google service in order to use the following features:
- Google Drive repository
- OAuth 2 authentication for enabling users to log in to Moodle with their Google account
- Google Drive converter for converting assignment submission files to PDF for teachers to annotate
OAuth 2 Google service setup
To set up an OAuth 2 client with Google, log in to the Google Developers Console and click the arrow by 'Select a project'.
Click 'Create a new project'
Give it a name. The name is not visible to anyone so you can choose any name you like.
Select "credentials" from the menu on the left.
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.
Now you can create some client credentials. Switch to the credentials tab and create a new OAuth client ID.
Setup the credentials for a Web Application. The most important setting here is to set the callback URL ("Authorized redirect URI"). 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. Make sure this box has saved properly.
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.
Finally we have to enable the Drive API (if we want to use the google drive repository or file converter plugins).
App verification
NOTE: If you are just using this for document conversion you will not need to verify (as it only uses one account). You will, however, need to verify your ownership of your domain (see, [1])
The Google Drive repository and Google Drive converter also require the app to be verified by completing the OAuth Developer Verification Form. The list of scopes that Moodle requires are: openid profile email https://www.googleapis.com/auth/drive
.
See the discussion Google Drive Repository and Moodle 3.3.1 for more details.