Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook API 2.2 will stop to work starting 27 March, 2017 (i.e. Facebook login is broken) / Fixed on master, need to be fixed on 2.5 and 2.6 #231

Closed
mouneyrac opened this issue Mar 1, 2017 · 7 comments

Comments

@mouneyrac
Copy link
Collaborator

mouneyrac commented Mar 1, 2017

I have been alerted that the current install of the 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 the issue soon. However I will be happy to merge a pull request (of course the code must work for people already using the plugin and for people that are going to use it).

@mouneyrac mouneyrac changed the title Facebook API 2.2 will stop to work starting 27 March, 2017 Facebook API 2.2 will stop to work starting 27 March, 2017 (i.e Facebook login is broken) Mar 28, 2017
@mouneyrac mouneyrac changed the title Facebook API 2.2 will stop to work starting 27 March, 2017 (i.e Facebook login is broken) Facebook API 2.2 will stop to work starting 27 March, 2017 (i.e. Facebook login is broken) Mar 28, 2017
@rabser
Copy link
Owner

rabser commented Mar 28, 2017

Dear Jérôme, i arranged to work your unbeatable plugin with facebook API 2.8, but the work was done on plugin->version=2014120101 for moodle 2.x.
With the latest one, i'm sincerely lost in finding the same pieces of code, but i can share with you my changes in the old code, and maybe it's simpler for you putting the same changes in the latest plugin.

These are the simple changes that works for me in moodle 2.x:
``
diff --git a/auth.php b/auth.php
index 78815e9..8449a05 100644
--- a/auth.php
+++ b/auth.php
@@ -116,6 +116,8 @@ class auth_plugin_googleoauth2 extends auth_plugin_base {
$requestaccesstokenurl = 'https://graph.facebook.com/oauth/access_token';
$params['redirect_uri'] = $CFG->wwwroot . '/auth/googleoauth2/facebook_redirect.php';
$params['code'] = $authorizationcode;

  •       $params['default_graph_version'] = 'v2.8';
    
  •       $params['default_access_token'] = '{access_token}';
                   break;
               case 'messenger':
                   $params['client_id'] = get_config('auth/googleoauth2', 'messengerclientid');
    

@@ -166,6 +168,8 @@ class auth_plugin_googleoauth2 extends auth_plugin_base {
//$tokentype = $postreturnvalues->token_type;
break;
case 'facebook':

  •                $accesstoken = json_decode($postreturnvalues)->access_token;
    
  •       break;
               case 'github':
                   parse_str($postreturnvalues, $returnvalues);
                   $accesstoken = $returnvalues['access_token'];
    

@mouneyrac
Copy link
Collaborator Author

Thanks Sergio. Actually I have a great news Damyon (from HQ) fixed the problem. We can all thanks him there #234

I am now going to backport it and publish fix a new version on Moodle.org

@mouneyrac
Copy link
Collaborator Author

Actually Sergio I may push your code for 2.6 and 2.5, can you send me a pull request for either of them?

@mouneyrac mouneyrac changed the title Facebook API 2.2 will stop to work starting 27 March, 2017 (i.e. Facebook login is broken) Facebook API 2.2 will stop to work starting 27 March, 2017 (i.e. Facebook login is broken) / Fixed on master, need to be fixed on 2.5 and 2.6 Mar 29, 2017
@rabser
Copy link
Owner

rabser commented Mar 29, 2017 via email

@mouneyrac
Copy link
Collaborator Author

It is a really great news Sergio. Can you share your version on Github, the one working with the latest phpleague client? I doubt anyone use battlenet, I added it for a personal project. However I suppose VK is widely use in russia so it would be an issue to upgrade this plugin if there is no implementation for the latest phpleague lib. Anyway we should encourage people to work on the core oauth2 implementation that is coming in Moodle 3.3

Don't worry for the pull request, I'll take your fix and try it on 2.6.

Thanks,
Jerome

@mouneyrac
Copy link
Collaborator Author

I pushed a fix in STABLE_25 and STABLE_26, closing.
Thanks to @rabser and @damyon .

@rabser
Copy link
Owner

rabser commented Mar 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants