OAuth 2 authentication: Difference between revisions
Helen Foster (talk | contribs) (→Enabling OAuth 2 authentication: make sure 'Show on login page' is ticked) |
Helen Foster (talk | contribs) (troubleshooting - how to get a green tick from https://moodle.org/mod/forum/discuss.php?d=353000) |
||
Line 24: | Line 24: | ||
# Go to 'Manage authentication' in Site administration and tick the box 'Prevent account creation when authenticating' (authpreventaccountcreation). | # Go to 'Manage authentication' in Site administration and tick the box 'Prevent account creation when authenticating' (authpreventaccountcreation). | ||
# Click the 'Save changes' button. | # Click the 'Save changes' button. | ||
==Troubleshooting== | |||
===On the 'OAuth 2 services' page, there is a red cross for 'Allow login'=== | |||
To get a green tick for Allow login, edit the OAuth 2 service and make sure that the setting 'Show on login page' is ticked. | |||
[[Category:OAuth 2]] | [[Category:OAuth 2]] |
Revision as of 12:19, 26 May 2017
The OAuth 2 authentication plugin enables users to log in using their Google, Microsoft and/or Facebook account. If enabled, when a user first logs in, a new account will be created. Otherwise, they will be prompted to link it to their existing account with the same email address.
Enabling OAuth 2 authentication
To use OAuth 2 authentication, an administrator must first create the required OAuth 2 services.
- Go to 'OAuth 2 services' in Site administration > Server and click the button to create a new service.
- Follow the instructions in OAuth 2 Google service, OAuth 2 Microsoft service or OAuth 2 Facebook service and obtain a client ID and secret.
- Enter the client ID and secret, make sure 'Show on login page' is ticked, then save changes.
Repeat for additional services as desired.
Next:
- Go to 'Manage authentication' in Site administration and enable the OAuth 2 authentication plugin.
- Optional: In the OAuth 2 settings, lock selected user data fields and save changes.
Preventing new account creation
If you don't want new accounts to be created when users log in with an OAuth 2 service:
- Go to 'Manage authentication' in Site administration and tick the box 'Prevent account creation when authenticating' (authpreventaccountcreation).
- Click the 'Save changes' button.
Troubleshooting
On the 'OAuth 2 services' page, there is a red cross for 'Allow login'
To get a green tick for Allow login, edit the OAuth 2 service and make sure that the setting 'Show on login page' is ticked.