/**
* Returns the authorize URL for a connection with the given
* slug. Abstracts away the differences between OAuth1 and
* OAuth2 for a uniform API.
*
* @param string $slug
* @param string $callbackUri
* @return string
*/
public function getAuthorizationUrl($slug, $callbackUri)
{
$provider = $this->make($slug, $callbackUri);
// OAuth 1 is a three-legged authentication process
// and thus we need to grab temporary credentials
// first.
if ($this->oauthVersion($provider) == 1) {
$temporaryCredentials = $provider->getTemporaryCredentials();
$this->session->put($temporaryCredentials);
return $provider->getAuthorizationUrl($temporaryCredentials);
}
return $provider->getAuthorizationUrl();
}