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

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

framgia/fauth-php
=================

Authentication User Framgia

1.0.0(8y ago)02151FramgiaPHP

Since Aug 7Pushed 7y ago7 watchersCompare

[ Source](https://github.com/framgia/fauth-php)[ Packagist](https://packagist.org/packages/framgia/fauth-php)[ RSS](/packages/framgia-fauth-php/feed)WikiDiscussions develop Synced 2d ago

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

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

[](#fauth-framgia-authentication)

### Installation

[](#installation)

To get started with FramgiaAuth, use Composer to add the package to your project's dependencies:

`composer require framgia/fauth-php`

Run the following command:

`composer update`

### Configuration

[](#configuration)

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

Also, add the Fauth facade to the aliases array in your app configuration file: `'Fauth' => Framgia\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) `"Framgia\\Fauth\\": "vendor/framgia/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:

```
