Social Login (Facebook Login)

Social Login (Facebook Login)

ni Kushan Rathnasekara -
Number of replies: 0

Dear Sir/Madam,

If you can share the following finding with appropriate group it will be a great help to others who have issues in configuring facebook login in moodle.

I was unable to configure facebook login in moodle for a long time even i followed every step of social login configuration document under oauth2 authentication. ( https://docs.moodle.org/33/en/OAuth_2_Facebook_service)

I've figured out what went wrong and i was able to resolve the same. For other those have the following issue, when configuring the facebook login for the moodle I would like to share my experience as I was looking to resolve this like from 7 months.

After configuring the facebook login as instructed and If you receive the following errors :




Pls note the following;

1. Your moodle server should be in HTTPS://
2. If any case if you installed the SSS certificate after installing the moodle in a http:// you should visit config.php and change the following changes.
a. $CFG->wwwroot = 'https://www.yourdomain.com'; // change http to https
b. $CFG->sslproxy = true; //include this line
3. Then you configure Facebook login the following error may come.

URL blocked: This redirect failed because the redirect URI is not white-listed in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs.


4. To resolve the issue, under facebook developer app settings If your Valid OAuth Redirect URIs is https://yourdomain.com/admin/oauth2callback.php in addition to that you have to include https://www.yourdomain.com/admin/oauth2callback.php as well. (www part also added as separate URI) This www added URI will fail under Redirect URI to Check validator. However, it should be entered under Valid OAuth Redirect URIs.

Thank you..

Average of ratings: -