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

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

javaabu/efaas-socialite
=======================

eFaas Provider for Laravel Socialite

v3.8.0(2mo ago)47.4k↓37.5%3MITPHPPHP ^7.4 || ^8.0CI passing

Since Dec 8Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/Javaabu/EFaas-Socialite)[ Packagist](https://packagist.org/packages/javaabu/efaas-socialite)[ Docs](https://github.com/Javaabu/EFaas-Socialite)[ RSS](/packages/javaabu-efaas-socialite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (9)Versions (29)Used By (0)

eFaas Laravel Socialite
=======================

[](#efaas-laravel-socialite)

[![Latest Version on Packagist](https://camo.githubusercontent.com/12903949401bb00de9bebc896030d92119431f6d76f12e579e2f39b1932bc84d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6176616162752f65666161732d736f6369616c6974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/javaabu/efaas-socialite)[![Test Status](../../actions/workflows/run-tests.yml/badge.svg)](../../actions/workflows/run-tests.yml)[![Code Coverage Badge](./.github/coverage.svg)](./.github/coverage.svg)[![Total Downloads](https://camo.githubusercontent.com/b90c49a70faf2e057347b0fe8346ba770e318335bd411b518df51061cbec437c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6176616162752f65666161732d736f6369616c6974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/javaabu/efaas-socialite)

[Laravel Socialite](https://github.com/laravel/socialite) Provider for [eFaas](https://efaas.gov.mv/).

**Note:** Current version of this package is based on eFaas Documentation version 2.2

- [eFaas Laravel Socialite](#efaas-laravel-socialite)
    - [Requirements](#requirements)
    - [Installation](#installation)
        - [Add configuration to your `.env` file](#add-configuration-to-your-env-file)
        - [Publishing the config file](#publishing-the-config-file)
        - [Publishing migrations](#publishing-migrations)
    - [Usage](#usage)
        - [Enabling PKCE](#enabling-pkce)
        - [Logging out the eFaas User](#logging-out-the-efaas-user)
        - [Using eFaas One-tap Login](#using-efaas-one-tap-login)
        - [Implementing Front Channel Single Sign Out](#implementing-front-channel-single-sign-out)
        - [Implementing Back Channel Single Sign Out](#implementing-back-channel-single-sign-out)
        - [Authenticating from mobile apps](#authenticating-from-mobile-apps)
        - [Changing the eFaas login prompt behaviour](#changing-the-efaas-login-prompt-behaviour)
        - [Available Methods for eFaas Provider](#available-methods-for-efaas-provider)
        - [Available Methods and Public Properties for eFaas User](#available-methods-and-public-properties-for-efaas-user)
        - [Changing the eFaas request scopes](#changing-the-efaas-request-scopes)
        - [Getting eFaas data from eFaas User object](#getting-efaas-data-from-efaas-user-object)
        - [Available eFaas data fields](#available-efaas-data-fields)
            - [Scope: efaas.openid](#scope-efaasopenid)
            - [Scope: efaas.profile](#scope-efaasprofile)
            - [Scope: efaas.email](#scope-efaasemail)
            - [Scope: efaas.mobile](#scope-efaasmobile)
            - [Scope: efaas.birthdate](#scope-efaasbirthdate)
            - [Scope: efaas.photo](#scope-efaasphoto)
            - [Scope: efaas.work\_permit\_status](#scope-efaasworkpermitstatus)
            - [Scope: efaas.passport\_number](#scope-efaaspassportnumber)
            - [Scope: efaas.country](#scope-efaascountry)
            - [Scope: efaas.permanent\_address](#scope-efaaspermanentaddress)
    - [Testing](#testing)
    - [Changelog](#changelog)
    - [Contributing](#contributing)
    - [Security](#security)
    - [Credits](#credits)
    - [License](#license)

Requirements
------------

[](#requirements)

This package requires the following:

- Laravel 6.0 or higher
- PHP 7.4 or higher
- ext-openssl PHP extension

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

[](#installation)

For Laravel 6.0+, you can install the package via `composer`:

```
composer require javaabu/efaas-socialite
```

For Laravel 5.6, use version 1.x

```
composer require javaabu/efaas-socialite:^1.0
```

### Add configuration to your `.env` file

[](#add-configuration-to-your-env-file)

Add the following config to your `.env` file

```
EFAAS_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
EFAAS_CLIENT_SECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
EFAAS_REDIRECT_URI=https://your-app.com/path/to/efaas/callback
EFAAS_MODE=development

# for production use
#EFAAS_MODE=production
```

### Publishing the config file

[](#publishing-the-config-file)

Optionally you can also publish the config file to `config/efaas.php`:

```
php artisan vendor:publish --provider="Javaabu\EfaasSocialite\Providers\EfaasSocialiteServiceProvider" --tag="efaas-config"
```

This is the default content of the config file:

```
