

$config = $this->config->get('services.twitter') protected function createTwitterDriver() * \Laravel\Socialite\One\AbstractProvider * Create an instance of the specified driver.
#Laravel socialite oauth2 how to#
Now my question is how to force the Socialite::driver('twitter') method to use Oauth2 instead of Oauth1 which basically is available in the Socialite itself ? i have tried to override the method but found no link to which instance is calling SocialiteManager.php, so currently i have only tried to modify the vendor function to return Oauth2 AbstractProvider (which i know its really ugly approach but i feel really curious), its like this : // /** Protected function createTwitterOAuth2Driver() * \Laravel\Socialite\Two\AbstractProvider $this->container->make('request'), new TwitterServer($this->formatConfig($config))īut in the same Laravel\Socialite\\SocialiteManager.php its also have method to create Oauth2 instance like below : /** $config = $this->config->get('services.twitter') * \Laravel\Socialite\One\AbstractProvider * Create an instance of the specified driver.

when i look at the vendor in Laravel\Socialite\\SocialiteManager.php its creating instance of this : /**

Thats when i realized that the currently used twitter provider is using Oauth1 Laravel\Socialite\One\TwitterProvider. I've beend trying to provide query parameters in the callback url using : Socialite::driver('twitter')īut Socialite return error Call to undefined method Laravel\\Socialite\\One\\TwitterProvider::redirectUrl()", I'm using Laravel 7 with Socialite v5.4.0 After successfully login the account info will be saved in MySQL along with user who registered the account. I'm currently developing social listening API with twitter, the flow is logged in user (using basic API Token to send request to the API) are redirected to twitter app and log in to twitter account through redirect link provided by Laravel Socialite.
