PHPackages                             saeedvir/socialite-slim - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. saeedvir/socialite-slim

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

saeedvir/socialite-slim
=======================

Laravel Socialite Slim provides a lightweight, expressive, fluent interface to OAuth authentication with Google, GitHub, and Telegram. It handles almost all of the boilerplate social authentication code you are dreading writing.

v1.1.0(1mo ago)111MITPHPPHP ^7.2|^8.0CI failing

Since Nov 13Pushed 1mo agoCompare

[ Source](https://github.com/saeedvir/socialite-slim)[ Packagist](https://packagist.org/packages/saeedvir/socialite-slim)[ Docs](https://github.com/saeedvir/socialite-slim)[ RSS](/packages/saeedvir-socialite-slim/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (17)Versions (6)Used By (0)

[![Logo Laravel Socialite](/art/logo.svg)](/art/logo.svg)

[![Build Status](https://github.com/saeedvir/socialite-slim/workflows/tests/badge.svg)](https://github.com/saeedvir/socialite-slim/actions)[![Total Downloads](https://camo.githubusercontent.com/b3e8283b9e5a6d30c27269af51ad8b2bfaf1cdab1fecbbb6d7c1aeee229cf79b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616565647669722f736f6369616c6974652d736c696d)](https://packagist.org/packages/saeedvir/socialite-slim)[![Latest Stable Version](https://camo.githubusercontent.com/415f5eff65657e836dc98fd146839396a868b8498ad0d73c312b5543deb92c6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616565647669722f736f6369616c6974652d736c696d)](https://packagist.org/packages/saeedvir/socialite-slim)[![License](https://camo.githubusercontent.com/e9360b5e04853d0367d7896d2d2dba07a408b19cd1f65e824f36e669f221e2c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73616565647669722f736f6369616c6974652d736c696d)](https://packagist.org/packages/saeedvir/socialite-slim)

Introduction
------------

[](#introduction)

Laravel Socialite Slim provides a lightweight, expressive, fluent interface to OAuth authentication with Google, GitHub, and Telegram.

What's New in v5.0
------------------

[](#whats-new-in-v50)

- ✅ **Laravel 13 Compatibility** - Updated dependencies to support latest Laravel versions
- 🔒 **Security Improvements** - Implemented timing-safe state comparison using `hash_equals()`
- 🧪 **Enhanced Testing** - Added `FakeProvider` and `SocialiteFake` for easy testing
- 📦 **Slim Distribution** - Removed non-essential files to keep package lightweight

Supported Providers
-------------------

[](#supported-providers)

- Google
- GitHub
- Telegram

OAuth Connected Users Feature
-----------------------------

[](#oauth-connected-users-feature)

This package includes a complete OAuth connected users system that allows you to track and manage OAuth connections for your users. For detailed documentation, please refer to the documentation in the repository (docs/ folder).

Installation
------------

[](#installation)

```
composer require saeedvir/socialite-slim
```

### Publish Migrations

[](#publish-migrations)

To use the OAuth connected users feature, publish the migrations:

```
php artisan vendor:publish --provider="Saeedvir\SocialiteSlim\SocialiteServiceProvider" --tag="socialite-migrations"
```

Then run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

After publishing the service provider, the package will automatically load its configuration from `config/socialite.php`. You can publish this configuration file with:

```
php artisan vendor:publish --provider="Saeedvir\SocialiteSlim\SocialiteServiceProvider" --tag="socialite-config"
```

Add your credentials to your `.env` file:

```
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_REDIRECT_URI=/auth/github/callback

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=/auth/google/callback

TELEGRAM_CLIENT_ID=your_telegram_bot_token
TELEGRAM_CLIENT_SECRET=your_telegram_bot_token
TELEGRAM_REDIRECT_URI=/auth/telegram/callback
```

Basic Usage
-----------

[](#basic-usage)

```
use Saeedvir\SocialiteSlim\Socialite;

// Redirect user to OAuth provider
return Socialite::driver('google')->redirect();

// Get user information from provider callback
$user = Socialite::driver('google')->user();

// Get specific user data
$user->getId();
$user->getNickname();
$user->getName();
$user->getEmail();
$user->getAvatar();
```

OAuth Connected Users Usage
---------------------------

[](#oauth-connected-users-usage)

```
use Saeedvir\SocialiteSlim\Facades\OAuth;

// Find or create an OAuth connected user
$oauthUser = OAuth::findOrCreateOauthUser(
    'google',
    $user->getId(),
    [
        'access_token' => $user->token,
        'refresh_token' => $user->refreshToken,
        'expires_in' => $user->expiresIn,
        'name' => $user->name,
        'email' => $user->email,
        'avatar' => $user->avatar
    ]
);

// Check if user has OAuth connection
$hasConnection = OAuth::userHasOauthConnection($userModel, 'google');

// Get OAuth user by provider and ID
$storedOauthUser = OAuth::getOauthUser('google', $googleUserId);
```

Advanced Features
-----------------

[](#advanced-features)

### Scopes and Parameters

[](#scopes-and-parameters)

```
// Add additional scopes
Socialite::driver('google')
    ->scopes(['openid', 'profile', 'email', 'https://www.googleapis.com/auth/calendar'])
    ->redirect();

// Add custom parameters
Socialite::driver('google')
    ->with(['hd' => 'example.com']) // Google Apps domain restriction
    ->redirect();
```

### Testing

[](#testing)

The package includes testing utilities for easy mocking:

```
use Saeedvir\SocialiteSlim\Socialite;
use Saeedvir\SocialiteSlim\Testing\SocialiteFake;

// In your tests:
Socialite::fake();

// Define a fake user for GitHub
Socialite::fake('github', (object) [
    'id' => '12345',
    'nickname' => 'githubuser',
    'name' => 'GitHub User',
    'email' => 'user@example.com',
]);

// Now Socialite::driver('github')->user() will return the fake user above
```

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Total

5

Last Release

31d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8615309?v=4)[saeed abdollahian](/maintainers/saeedvir)[@saeedvir](https://github.com/saeedvir)

---

Top Contributors

[![saeedvir](https://avatars.githubusercontent.com/u/8615309?v=4)](https://github.com/saeedvir "saeedvir (24 commits)")

---

Tags

laravellaravel-packagelaravel12laravelpackagepackagesocialitesocialite-loginsocialite-providerslaravelgoogleoauthsocialitegithubtelegram

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saeedvir-socialite-slim/health.svg)

```
[![Health](https://phpackages.com/badges/saeedvir-socialite-slim/health.svg)](https://phpackages.com/packages/saeedvir-socialite-slim)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k113.1M997](/packages/laravel-socialite)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[illuminate/auth

The Illuminate Auth package.

9328.5M1.4k](/packages/illuminate-auth)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
