授权twitter和facebook时在url中传递自定义值

When I have a user authorize to use my app for Facebook and Twitter 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);