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

OAuth 2 Facebook service: Difference between revisions

From MoodleDocs
No edit summary
Line 15: Line 15:
[[File:facebook-3-basic-settings.png|none|frame|Basic settings]]
[[File:facebook-3-basic-settings.png|none|frame|Basic settings]]


On the left side menu, choose "+ Add product" and add "Facebook Login" product to the app. (Choose "Get started" button)
On the left side menu, choose "+ Add product".


[[File:facebook-4-add-product.png|none|frame|Add a product]]
[[File:facebook-4-add-product.png|none|frame|Add a product]]
Add "Facebook Login" product to the app. (Choose "Get started" button)
[[File:facebook-login.png|none|frame|Facebook Login]]
Next, choose "Web":
[[File:facebook-choose-platform.png|none|frame|Choose "Web"]]
Next, set your site URL:
[[File:facebook-webapp-wizard.png|none|frame|Set site URL]]
Click "Save", Click "Continue", click "Next" several times to go to the end of the wizard, until you see the following page with the "Back" button.
Then, go to the "Settings" page on the left menu
[[File:facebook-webapp-wizard-siteurl.png|none|frame|Go to the "Settings" page on the left menu]]


Configure the OAuth settings. Set the callback URL to "your site url + /admin/oauth2callback.php". If your moodle site is available at <nowiki>https://lemon.edu/</nowiki> then the callback URL should be set to <nowiki>https://lemon.edu/admin/oauth2callback.php</nowiki>. Enable the Web OAuth Login but for best security disable all other types of login.
Configure the OAuth settings. Set the callback URL to "your site url + /admin/oauth2callback.php". If your moodle site is available at <nowiki>https://lemon.edu/</nowiki> then the callback URL should be set to <nowiki>https://lemon.edu/admin/oauth2callback.php</nowiki>. Enable the Web OAuth Login but for best security disable all other types of login.

Revision as of 20:33, 31 May 2017


Setup App in Facebook

To setup an OAuth 2 client with Facebook, first we need to log in to the Facebook for Developers Apps page and create a new app.

New App

Enter the name for the new App and choose a category (Education?).

Name it

On the left site menu, choose "settings" and fill in the basic settings: app icon, URLs to your privacy policy and terms of service.

Basic settings

On the left side menu, choose "+ Add product".

Add a product

Add "Facebook Login" product to the app. (Choose "Get started" button)

Facebook Login

Next, choose "Web":

Choose "Web"

Next, set your site URL:

Set site URL

Click "Save", Click "Continue", click "Next" several times to go to the end of the wizard, until you see the following page with the "Back" button.

Then, go to the "Settings" page on the left menu

Go to the "Settings" page on the left menu

Configure the OAuth settings. Set the callback URL to "your site url + /admin/oauth2callback.php". If your moodle site is available at https://lemon.edu/ then the callback URL should be set to https://lemon.edu/admin/oauth2callback.php. Enable the Web OAuth Login but for best security disable all other types of login.

OAuth settings

Go to App Review and make your App public.

Make it public

Finally go to the basic settings and get the App ID and App secret and enter them in Moodle as the Client ID and Client Secret.