开发者

Passing custom values in url when authorizing twitter and facebook

When I have a user authorize to use my app for Facebook and Twitte开发者_运维知识库r using their API, how can I pass Facebook and Twitter custom variables so that if the user does authorize their account to use my Facebook and Twitter app the callback URL will contain the custom data I need on my side? I'm using the PHP API class for both.


I figured it out for Twitter. Using the latest SDK:

twitterObj->getAuthenticateUrl(null,array(
                                    'oauth_callback' => '{customcallbackurlhere}'
                                    )
);

Ok, it looks like I found it for Facebook too:

    $params = array(
        'fbconnect'=>0,
        'canvas'=>0,
        'scope'=>'{permissionshere}',
        'redirect_uri' => '{callbackurlhere}'       
    );

    $loginUrl = $facebook->getLoginUrl($params);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜