O-Auth Facebook authentication error

O-Auth Facebook authentication error

by Alosies George -
Number of replies: 7

Hi, 

Suddenly we are getting this error in our website (learn.georgeprep.com) when we try to log-in through facebook. Can anyone please help on how to resolve this?


Error: 

Exception - Required option not passed: access_token Array ( [{"access_token":"EAADFqJDVYfEBAGOmyXyPZCzLg2j27GZARQDFoi3ZCZCGqq4qqvQZBeZAtUGn1JL5M7um

HCZBK4zZBbDIpgPgzTFxcss1V8m7cCEnpZAZAV6wF3ogplbE0fyAsHWJZBLfECfZBoxK6rRjAdyQ1oYZCo6V7cDUVpZB

IZAhLvVpyMZD","token_type":"bearer","expires_in":5131596}] => )

Attachment Jpeg.jpg
Average of ratings: -
In reply to Alosies George

Re: O-Auth Facebook authentication error

by Magal H -

Hi, did you figure this one out? we're getting the same error since today.

In reply to Alosies George

Tárgy: O-Auth Facebook authentication error

by Barczi Zsolt -

I have the same problem. 

Is this Facebook error or O-auth? (linkedin login works perfectly)

Can somebody resolve this problem?  

In reply to Alosies George

Re: O-Auth Facebook authentication error

by Magal H -

It would be great if the first one who solves this can share the fix. This has become urgent. All our facebook users are locked out.

In reply to Magal H

Re: O-Auth Facebook authentication error

by Damyon Wiese -

The maintainer of the googleauth2 plugin is aware of the issue and I just sent him a pull request to address it.


https://github.com/mouneyrac/moodle-auth_googleoauth2/pull/234/commits/b9d0e98aa64d7c3b6e5ed3ecbc09b9aafe28a101


If you just want to get the changes right now - download this file: https://raw.githubusercontent.com/damyon/moodle-auth_googleoauth2/b9d0e98aa64d7c3b6e5ed3ecbc09b9aafe28a101/classes/provider/facebook.php

and copy it over the top of the file at auth/googleoauth2/classes/provider/facebook.php.


Average of ratings: Useful (1)
In reply to Damyon Wiese

Re: O-Auth Facebook authentication error

by Alosies George -

Hi Damyon, 

This came as a blessing in disguise. Thanks a lot for your help. Much appreciated. 


Solution Working: I just did exactly what is there in Damyon's post and it sorted the issue. Facebook login is back on track.

In reply to Alosies George

Re: O-Auth Facebook authentication error

by Alosies George -

It is a problem cause by a change in Facebook. Facebook deprecated their Graph API version 2.2 which is the version supported by Moodle's leading Oauth Plugin (https://moodle.org/plugins/auth_googleoauth2). 


The Plugin description clearly says the following

Warning for Facebook users: I have been alerted that the current install of this plugin will stop working with Facebook API 2.2 the 27 March (it was already not working for the facebook API 2.8 and later). Unhappily I do not foresee any fix to this issue. However I will be happy to merge a pull request.

Facebook not working anymore
Facebook changed the API in its 2.8 version and it is not compatible with the plugin. Moreover the plugin is compatible with the old Facebook API 2.2 which is ending the 27th of March 2017. So it is likely that the Facebook login will stop to work at this date. In the comments you will find a script to put in your root folder to detect who is using facebook and so you can alter your users.

Although certain other alternatives are given for this plugin in the description page itself, none of them seem to be working with the current facebook Graph API version 2.8. 

We have a login system that allows login only through Facebook and hence all our users have been logged out for more than a day now. This is a serious issue for us, sadly no one is able to help out.