philsturgeon / codeigniter-oauth2

NO LONGER ACTIVELY MAINTAINED. USE https://github.com/thephpleague/oauth2-client INSTEAD
http://getsparks.org/packages/oauth2/versions/HEAD/show
352 stars 177 forks source link

Providers get_user_info() Token Reference #7

Closed fisherinnovation closed 12 years ago

fisherinnovation commented 12 years ago

From the main call in the oauth2 class:

$user = $provider->get_user_info($token->access_token);

I have only tested this with Facebook so far but within get_user_info - the initial call with the users access token

$url = 'https://graph.facebook.com/me?'.http_build_query(array( 'access_token' => $token->access_token, ));

Is improperly referencing the token string. Since '$token->access_token' is passed into 'get_user_info' the token is no longer an object but a string.Thus,

$url = 'https://graph.facebook.com/me?'.http_build_query(array( 'access_token' => $token, ));

Allows the token to properly be passed.

philsturgeon commented 12 years ago

Newer versions of this will throw an exception if the parameter is not an object. Pass the whole object, not just the string.