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.0.3(2mo ago)19MITPHPPHP ^7.2|^8.0CI failing

Since Nov 13Pushed 2mo agoCompare

[ Source](https://github.com/saeedvir/socialite-slim)[ Packagist](https://packagist.org/packages/saeedvir/socialite-slim)[ Docs](https://github.com/saeedvir/socialite-slim)[ Fund](https://www.buymeacoffee.com/saeedvir)[ GitHub Sponsors](https://github.com/saeedvir)[ RSS](/packages/saeedvir-socialite-slim/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (5)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. It handles almost all of the boilerplate social authentication code you are dreading writing.

- [Chat With AI for Socialite Slim](https://context7.com/saeedvir/socialite-slim?tab=chat)

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

[](#supported-providers)

- Google
- GitHub
- Telegram

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

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

This package now includes a complete OAuth connected users system that allows you to track and manage OAuth connections for your users. See [OAUTH-README.md](OAUTH-README.md) for detailed documentation.

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 installing the Socialite Slim library, register the `Saeedvir\SocialiteSlim\SocialiteServiceProvider` in your `config/app.php` configuration file:

```
'providers' => [
    // Other service providers...

    Saeedvir\SocialiteSlim\SocialiteServiceProvider::class,
],
```

Also, add the `Socialite` facade to the `aliases` array in your `config/app.php` configuration file:

```
'aliases' => [
    // Other aliases...

    'Socialite' => Saeedvir\SocialiteSlim\Facades\Socialite::class,
    'OAuth' => Saeedvir\SocialiteSlim\Facades\OAuth::class,
],
```

You will also need to add credentials for the OAuth services your application utilizes. These credentials should be placed in your `config/services.php` configuration file, and should use the key `google`, `github`, or `telegram`, depending on the providers your application needs:

```
'google' => [
    'client_id' => env('GOOGLE_CLIENT_ID'),
    'client_secret' => env('GOOGLE_CLIENT_SECRET'),
    'redirect' => 'http://your-callback-url',
],

'github' => [
    'client_id' => env('GITHUB_CLIENT_ID'),
    'client_secret' => env('GITHUB_CLIENT_SECRET'),
    'redirect' => 'http://your-callback-url',
],

'telegram' => [
    'client_id' => env('TELEGRAM_CLIENT_ID'),
    'client_secret' => env('TELEGRAM_CLIENT_SECRET'),
    'redirect' => 'http://your-callback-url',
],
```

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

[](#basic-usage)

```
