374 comments

  1. Even 3 years old, this extention still helped me greatly to implement my own Social-Connect module.
    I started off using Inchoo’s but made so many adjustments in the end (most of them for “style” issues rather than functionality issues), that I decided to write my own from scratch. For everyone who wants to use Inchoo’s extention today, two things I remember that could help making it work more smoothly:

    Facebook API
    Like Santiago Glez already mentioned, https://graph.facebook.com/(v2.8/)me now expects field parameters. For that reason I changeed the $client->api call in FacebookController.php (within _connectCallback()) to:

    $userInfo = $client->api('/me', 'GET', array('fields'=>'id,first_name,last_name,email,...'));<code></pre>
    
    (I added the API version to all URIs in Model/Facebook/Client.php (OAUTH2_SERVICE_URI, OAUTH2_AUTH_URI, OAUTH2_TOKEN_URI). I didn't test if it's necessary functionality-wise by I think it's kinda useful considering future changes.)
    
    <strong>Twitter API</strong>
    Twitter didn't hand out their users' email addresses when this extension was written, now it does - well, with a little convincing at least and as long as the user has confirmed their email address. (<a href="https://dev.twitter.com/rest/reference/get/account/verify_credentials" title="Twitter Docs">read up here</a>).
    In order to get and use the user's email from Twitter I made a small change in TwitterController.php (within <em>_connectCallback()</em> again)  where the $client->api method is called:
    <pre><code>$userInfo = $client->api('/account/verify_credentials.json', 'GET', array('include_email' => 'true', 'skip_status' => 'true'));
    $fallbackEmail = sprintf('%s@twitter-user.com', strtolower($userInfo->screen_name));
    if(!isset($userInfo->email)) $userInfo->email = $fallbackEmail;

    (I was saving the $fallbackEmail to check at the function’s end if an address could be retrieved or whether the old standard notification about being unable to the address was necessary.)

    I don’t remember encountering any issues with the Google API.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.