MDL-61826 auth: Facebook OAuth2 - getting a better-quality profile photo
authorŁukasz Szeremeta <l.szeremeta.dev@gmail.com>
Mon, 2 Apr 2018 21:03:38 +0000 (23:03 +0200)
committerJun Pataleta <jun@moodle.com>
Wed, 6 Jun 2018 04:09:09 +0000 (12:09 +0800)
Get 200x200 px instead of 50x50 px user profile picture from Facebook OAuth2.

lib/classes/oauth2/api.php

index 72d4e97..179910d 100644 (file)
@@ -89,7 +89,7 @@ class api {
         $endpoints = [
             'authorization_endpoint' => 'https://www.facebook.com/v2.12/dialog/oauth',
             'token_endpoint' => 'https://graph.facebook.com/v2.12/oauth/access_token',
-            'userinfo_endpoint' => 'https://graph.facebook.com/v2.12/me?fields=id,first_name,last_name,link,picture,name,email'
+            'userinfo_endpoint' => 'https://graph.facebook.com/v2.12/me?fields=id,first_name,last_name,link,picture.type(large),name,email'
         ];
 
         foreach ($endpoints as $name => $url) {