PHPackages                             setemares/freee-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. setemares/freee-socialite

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

setemares/freee-socialite
=========================

Freee OAuth2 Provider for Laravel Socialite

v0.1.2(7y ago)09MITPHPPHP ^5.6 || ^7.0

Since Feb 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/SeteMares/freee-socialite)[ Packagist](https://packagist.org/packages/setemares/freee-socialite)[ RSS](/packages/setemares-freee-socialite/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

Freee Socialite Provider
========================

[](#freee-socialite-provider)

This repository contains [Freee](https://developer.freee.co.jp/) provider for Laravel [Socialite](https://github.com/laravel/socialite).

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Problems](#problems)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

```
$ composer require setemares/freee-socialite
```

- You will need to extend Socialite in order to add Freee provider, go to AppServiceProvider.php and add:

```
use SeteMares\Freee\Provider as FreeeProvider;
```

- To the `boot()` method add:

```
    $this->bootFreeeSocialite();
```

- And create this method:

```
    private function bootFreeeSocialite()
    {
        $socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
        $socialite->extend('freee', function ($app) use ($socialite) {
            $config = $app['config']['services.freee'];
            return $socialite->buildProvider(FreeeProvider::class, $config);
        });
    }
```

Configuration
-------------

[](#configuration)

- Add to `config/services.php`:

```
'freee' => [
    'client_id' => env('FREEE_CLIENT_ID', ''),
    'client_secret' => env('FREEE_CLIENT_SECRET', ''),
    'redirect' => env('FREEE_CALLBACK', 'urn:ietf:wg:oauth:2.0:oob')
]
```

- Add config variables to your `.env` file:

```
# Freee
FREEE_CLIENT_ID=Your_client_id
FREEE_CLIENT_SECRET=Your_client_secret
FREEE_CALLBACK=Your_callback_url
```

Usage
-----

[](#usage)

- To get token use as any other socialite provider, e.g.

```
    public function oauthRedirect()
    {
        return Socialite::driver('freee')
            ->with(['access_type' => 'offline'])
            ->redirect();
    }
    public function oauthCallback()
    {
        try {
            $user = Socialite::driver('freee')
                ->user();
        } catch (\Exception $e) {
            return $this->respondError(Lang::getFromJson("No user in oauth response"), 422);
        }
        // $user contains freee user `id` and `companies` array besides
        // token information (`token`, `expiresIn`, `refreshToken`)
    }
```

- To refresh token, call provided method refreshToken($refresh\_token)

```
    try {
        $data = Socialite::driver('freee')->refreshToken($refreshToken);
    } catch (\Exception $e) {
        // GuzzleHttp\Exception\ClientException:
        return $e->getMessage());
    }
```

Problems
--------

[](#problems)

- Freee will reject issuing access code needed for obtaining access token if there is anything besides `urn:ietf:wg:oauth:2.0:oob` configured in `redirect_uri`, having `urn:ietf:wg:oauth:2.0:oob` in it will present token on screen, requiring user to manually copy the code and paste it into your app to continue the authentication flow.
- Another, more serious problem is with the ability to refresh token, when access token being issued without problem but upon it's expiration Freee api will refuse to provide new access token with `invalid_grant` error requiring user to repeat authentication flow.

Credits
-------

[](#credits)

- [tectiv3](https://github.com/tectiv3)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

2652d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d20415d0463d555e025b5063c5cc9029ef2202dc144d93162dc32ec6fb7b347e?d=identicon)[tectiv3](/maintainers/tectiv3)

---

Top Contributors

[![tectiv3](https://avatars.githubusercontent.com/u/1974189?v=4)](https://github.com/tectiv3 "tectiv3 (10 commits)")

---

Tags

freeelaravelsocialitesocialite-providers

### Embed Badge

![Health badge](/badges/setemares-freee-socialite/health.svg)

```
[![Health](https://phpackages.com/badges/setemares-freee-socialite/health.svg)](https://phpackages.com/packages/setemares-freee-socialite)
```

###  Alternatives

[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

326.1M13](/packages/socialiteproviders-microsoft)[socialiteproviders/apple

Apple OAuth2 Provider for Laravel Socialite

618.4M8](/packages/socialiteproviders-apple)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

421.9M5](/packages/socialiteproviders-instagram)[socialiteproviders/microsoft-azure

Microsoft Azure OAuth2 Provider for Laravel Socialite

556.0M19](/packages/socialiteproviders-microsoft-azure)[socialiteproviders/laravelpassport

LaravelPassport OAuth2 Provider for Laravel Socialite

621.3M7](/packages/socialiteproviders-laravelpassport)[socialiteproviders/discord

Discord OAuth2 Provider for Laravel Socialite

422.0M17](/packages/socialiteproviders-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
