Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

laravel/socialite v5.11.0

Laravel wrapper around OAuth 1 & OAuth 2 libraries.
Package summary
Share
0
issues
0
licenses
Package created
22 Aug 2014
Version published
2 Dec 2023
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does laravel/socialite do?

Laravel Socialite is a package that provides a fluent and expressive interface for OAuth authentication with various popular platforms like Facebook, Twitter, Google, LinkedIn, GitHub, GitLab, and Bitbucket. A key feature of Laravel Socialite is that it manages much of the boilerplate social authentication code, thereby reducing redundancy and speeding up the development process.

How do you use laravel/socialite?

Laravel Socialite is quite straightforward to use. First, you need to install it via composer by running the command composer require laravel/socialite.

To authenticate with a particular service, such as Facebook, you would configure your services in your config/services.php file:

'facebook' => [
    'client_id' => env('FACEBOOK_CLIENT_ID'),  
    'client_secret' => env('FACEBOOK_CLIENT_SECRET'), 
    'redirect' => env('FACEBOOK_REDIRECT_URL'),  
],

Next, within your controller, you can redirect the user to the OAuth provider:

use Laravel\Socialite\Facades\Socialite;

public function redirectToProvider()
{
    return Socialite::driver('facebook')->redirect();
}

The user will then be redirected back to your application, where you may retrieve their information:

public function handleProviderCallback()
{
    $user = Socialite::driver('facebook')->user();

    // $user->token;
}

Remember that this is merely an example, the actual implementation may vary based on your application's specific requirements.

Where are the laravel/socialite docs?

The official documentation for Laravel Socialite can be found on the Laravel website at https://laravel.com/docs/socialite. This serves as a comprehensive guide, providing detailed insights into the package, its use cases, and various features. It also outlines the methods to implement social authentication via different OAuth providers.