PHPackages                             trandinhvi39/fauth - 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. trandinhvi39/fauth

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

trandinhvi39/fauth
==================

Authentication User Framgia

37PHP

Since Aug 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/trandinhvi39/fauth)[ Packagist](https://packagist.org/packages/trandinhvi39/fauth)[ RSS](/packages/trandinhvi39-fauth/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

FAuth (Framgia Authentication)
------------------------------

[](#fauth-framgia-authentication)

### Installation

[](#installation)

Add the following to your composer.json

```
"repositories": [
    {
    "url": "https://github.com/trandinhvi39/fauth",
    "type": "git"
    }
],

"require": {
    "trandinhvi39/fauth" : "dev-master"
}

```

Run the following command: `composer update`

### Configuration

[](#configuration)

After installing the Fauth library, register the Trandinhvi39\\Fauth\\FAuthServiceProvider in your config/app.php configuration file: `Trandinhvi39\Fauth\FAuthServiceProvider::class,`

Also, add the Fauth facade to the aliases array in your app configuration file: `'Fauth' => Trandinhvi39\Fauth\Facades\Fauth::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 framgia for the framgia provider. For example:

```
'framgia' => [
    'client_id' => 'your-auth-framgia-app-id',
    'client_secret' => 'your-auth-framgia-app-secret',
    'base_url' => 'http://domain-auth-server',
    'redirect' => 'http://your-callback-url',
],

```

Add the following to your composer.json (autoload-dev -&gt; psr-4) `"Trandinhvi39\\Fauth\\": "vendor/trandinhvi39/fauth/"`

Run below command: `composer dump-autoload`

### 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 Fauth using the Fauth facade:

```
