diff --git a/libraries/Provider/Instagram.php b/libraries/Provider/Instagram.php index 39c8bef..869ff7b 100644 --- a/libraries/Provider/Instagram.php +++ b/libraries/Provider/Instagram.php @@ -33,7 +33,17 @@ public function url_access_token() public function get_user_info(OAuth2_Token_Access $token) { - $user = $token->user; + $url = 'https://api.instagram.com/v1/users/self/?'; + $url .= http_build_query + ( + array + ( + 'access_token' => $token->access_token, + ) + ); + + $user = json_decode(file_get_contents($url)); + $user = $user->data; return array( 'uid' => $user->id, @@ -45,4 +55,4 @@ public function get_user_info(OAuth2_Token_Access $token) ), ); } -} \ No newline at end of file +}