PHPackages                             sas1024/socialite-xenforo-bdapi - 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. sas1024/socialite-xenforo-bdapi

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

sas1024/socialite-xenforo-bdapi
===============================

XenForo over \[bd\] Api OAuth2 Provider for Laravel Socialite

v1.0.0(8y ago)332[1 issues](https://github.com/sas1024/socialite-xenforo-bdapi/issues)MITPHPPHP &gt;=5.5.9

Since Aug 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sas1024/socialite-xenforo-bdapi)[ Packagist](https://packagist.org/packages/sas1024/socialite-xenforo-bdapi)[ RSS](/packages/sas1024-socialite-xenforo-bdapi/feed)WikiDiscussions master Synced yesterday

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

XenForo \[bd\] Api Provider for Laravel Socialite
=================================================

[](#xenforo-bd-api-provider-for-laravel-socialite)

Installation and config
-----------------------

[](#installation-and-config)

Install Larvel Socialite (see here: )

Install the \[bd\] Api to your XenForo installation (see here: )

Install the XenForo \[bd\] Api socialite provider

```
composer require sas1024/socialite-xenforo-bdapi

```

Add the Event and Listener
--------------------------

[](#add-the-event-and-listener)

Add SocialiteProviders\\Manager\\SocialiteWasCalled::class event to your listen\[\] array in &lt;app\_name&gt;/Providers/EventServiceProvider like this:

```
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'App\Events\Event' => [
            'App\Listeners\EventListener',
        ],
        SocialiteWasCalled::class => [
            'Sas1024\Socialite\XenForo\XenForoExtendSocialite@handle',
        ],
    ];
```

Services Array and .env:
------------------------

[](#services-array-and-env)

Add to config/services.php:

```
    'xenforo' => [
        'client_id' => env('XENFORO_CLIENT_ID'),
        'client_secret' => env('XENFORO_CLIENT_SECRET'),
        'redirect' => env('XENFORO_CALLBACK_URL'),
        'xenforo_url' => env('XENFORO_URL'),
    ],
```

Append provider values to your .env file: **Note: Add both public and secret keys!**

```
XENFORO_CLIENT_ID=
XENFORO_CLIENT_SECRET=
XENFORO_CALLBACK_URL=
XENFORO_URL=

```

Example:

```
XENFORO_CLIENT_ID=kaupfd1fscx
XENFORO_CLIENT_SECRET=oAnW4NUK1iHLl58PjpQI
XENFORO_CALLBACK_URL=${APP_URL}/login/xenforo/callback
XENFORO_URL=http://xenforo-with-bd.local/forum/api/

```

Usage
-----

[](#usage)

```
