PHPackages                             katsana/socialite - 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. katsana/socialite

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

katsana/socialite
=================

KATSANA Socialite Provider

v1.3.0(2y ago)12.2k↓50%2BSD-3-ClausePHPPHP ^7.3 || ^8.0

Since Jan 10Pushed 1y ago3 watchersCompare

[ Source](https://github.com/katsana/katsana-socialite)[ Packagist](https://packagist.org/packages/katsana/socialite)[ RSS](/packages/katsana-socialite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (7)Versions (11)Used By (0)

KATSANA Socialite Provider
==========================

[](#katsana-socialite-provider)

[![Build Status](https://camo.githubusercontent.com/b47e93c028314f730c6eccbf9cc18884cf23c7f60c2218a22172a5603d335833/68747470733a2f2f7472617669732d63692e6f72672f6b617473616e612f6b617473616e612d736f6369616c6974652e7376673f6272616e63683d312e30)](https://travis-ci.org/katsana/katsana-socialite)[![Latest Stable Version](https://camo.githubusercontent.com/b155f204cc8ff40dd53715a17b00244bb7267544e49f749a2c1be0bf5e307aca/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f736f6369616c6974652f762f737461626c65)](https://packagist.org/packages/katsana/socialite)[![Total Downloads](https://camo.githubusercontent.com/9b6c18095d69147c5f9fdf03888cb4a7e68d78bf6fbe9a65d5ce4abbf1e8ce49/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f736f6369616c6974652f646f776e6c6f616473)](https://packagist.org/packages/katsana/socialite)[![Latest Unstable Version](https://camo.githubusercontent.com/774459fff0d44d021a5f8408fdcd5f93a9ed0d7e9b2a4656f4b08e74f6e89f39/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f736f6369616c6974652f762f756e737461626c65)](https://packagist.org/packages/katsana/socialite)[![License](https://camo.githubusercontent.com/fca3f150d906fa721167c1481a3136578980a6610bb26c639e9236b9248f6bd3/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f736f6369616c6974652f6c6963656e7365)](https://packagist.org/packages/katsana/socialite)

- [Installation](#installation)

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

[](#installation)

To install through composer, simply put the following in your `composer.json` file:

```
{
  "require": {
    "katsana/socialite": "^1.0"
  }
}
```

Official Documentation
----------------------

[](#official-documentation)

### Configuration

[](#configuration)

KATSANA Socialite is built using [SocialiteProviders](http://socialiteproviders.github.io/). First, you need to register the service provides in your `config/app.php` configuration file:

```
'providers' => [

    // Other service providers...
    Katsana\ServiceProvider::class,
    Laravel\Socialite\SocialiteServiceProvider::class,
    SocialiteProviders\Manager\ServiceProvider::class,

],
```

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

```
'Katsana' => Katsana\Katsana::class,
'Socialite' => Laravel\Socialite\Facades\Socialite::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. For example:

```
'katsana' => [
    'environment' => 'production',
    'client_id' => 'your-katsana-client-id',
    'client_secret' => 'your-katsana-client-secret',
    'redirect' => 'http://your-callback-url',
    //Optional
    'endpoints'=>[
        'api' => 'http://katsana-api-endpoint',
        'oauth' => 'http://katsana-outh-endpoint',
    ],
    'includes'=>'extra_profile_data',
],
```

Finally, you need to add `Katsana\Socialite\Bootstrap` to be triggered by `SocialiteProviders\Manager\SocialiteWasCalled` event. To do so, edit your `App\Providers\EventServiceProvider`.

```
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        // Other events...
        \SocialiteProviders\Manager\SocialiteWasCalled::class => [
            \Katsana\Socialite\Bootstrap::class,
        ],
    ];
```

### Basic Usage

[](#basic-usage)

Next, you are ready to authenticate users! You will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. We will access Socialite using the `Socialite` facade:

```
