PHPackages                             kneu/laravel-socialite-provider - 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. kneu/laravel-socialite-provider

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

kneu/laravel-socialite-provider
===============================

KNEU Provider for laravel/socialite package.

v2.0.0(8y ago)01161MITPHP

Since Dec 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/berejant/kneu-laravel-socialite-provider)[ Packagist](https://packagist.org/packages/kneu/laravel-socialite-provider)[ RSS](/packages/kneu-laravel-socialite-provider/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

KNEU Laravel Socialite
======================

[](#kneu-laravel-socialite)

KNEU Provider for [Laravel Socialite Providers](https://socialiteproviders.github.io/).

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

[](#installation)

### 1. Composer

[](#1-composer)

Add package to your laravel project via composer

```
composer require kneu/laravel-socialite-provider

```

### 2. Add service provider

[](#2-add-service-provider)

- Remove `Laravel\Socialite\SocialiteServiceProvider` from your `providers[]` array in `config\app.php` if you have added it already.
- Add `\SocialiteProviders\Manager\ServiceProvider::class` to your `providers[]` array in `config\app.php`.

For example:

```
    'providers' => [
        ...
        // remove 'Laravel\Socialite\SocialiteServiceProvider',
        \SocialiteProviders\Manager\ServiceProvider::class, // add
    ];
```

### 3. Add the Event and Listeners

[](#3-add-the-event-and-listeners)

- Add `SocialiteProviders\Manager\SocialiteWasCalled` event to your `listen[]` array in `/Providers/EventServiceProvider`.
- Add listener `'\SocialiteProviders\Kneu\KneuExtendSocialite@handle'` to the `SocialiteProviders\Manager\SocialiteWasCalled[]`.

For example:

```
    protected $listen = [
        ...
        \SocialiteProviders\Manager\SocialiteWasCalled::class  => [
            ...
            '\SocialiteProviders\Kneu\KneuExtendSocialite@handle',
        ],
    ];
```

### 3. Add configuration to `config/services.php`

[](#3-add-configuration-to-configservicesphp)

```
'kneu' => [
  'client_id' => env('KNEU_KEY'),
  'client_secret' => env('KNEU_SECRET'),
  'redirect' => env('KNEU_REDIRECT_URI')
],

```

### 4. Environment Variables

[](#4-environment-variables)

Append provider values to your `.env` file

```
KNEU_KEY=your_application_id
KNEU_SECRET=your_secret
KNEU_REDIRECT_URI=https://example.com/login/complete

```

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

[](#basic-usage)

Next, you are ready to authenticate users via KNEU! You will need tree routes:

- first for redirecting the user to the KNEU OAuth provider
- second for receiving the callback from the KNEU provider after authentication
- third for logout.

Example of Controller

```
