artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4
683 stars 215 forks source link

Twitter oauth/request_token #142

Open ViktorKudlai opened 9 years ago

ViktorKudlai commented 9 years ago

Hi everybody. I trying to retreive Twitter oauth_token using Twitter API method oauth/request_token. How can I send POST request using artdarek wrapper? Thanks.

ViktorKudlai commented 9 years ago

I figure out how I can solve this problem.

public function getTwitterToken() {
        $tw = OAuth::consumer('Twitter', URL::to('auth/social/tw'));
        $reqToken = $tw->requestRequestToken();
        $url = $tw->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));

        return Redirect::to((string) $url);
}