PHPackages                             girift/apitwist-sso-laravel-client - 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. girift/apitwist-sso-laravel-client

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

girift/apitwist-sso-laravel-client
==================================

This is the client Integration with ApiTwist SSO.

0.2.2(1y ago)0785[3 PRs](https://github.com/GiriftEdTech/apitwist-sso-laravel-client/pulls)MITPHPPHP ^8.0CI passing

Since Sep 13Pushed 1w ago1 watchersCompare

[ Source](https://github.com/GiriftEdTech/apitwist-sso-laravel-client)[ Packagist](https://packagist.org/packages/girift/apitwist-sso-laravel-client)[ Docs](https://github.com/GiriftEdTech/apitwist-sso-laravel-client)[ RSS](/packages/girift-apitwist-sso-laravel-client/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (7)Versions (41)Used By (0)

This is the client Integration with ApiTwist SSO.
=================================================

[](#this-is-the-client-integration-with-apitwist-sso)

[![Latest Version on Packagist](https://camo.githubusercontent.com/edc07f92d6b8636f663b04be8f9b403427d7b79a16eb3a93c446ee130628356f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4769726966742f61706974776973742d73736f2d6c61726176656c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Girift/apitwist-sso-laravel-client)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d42f3ef72a7148f284e976d86ce37c51d8f010fad16b1459c60bcc55f0cd8620/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f4769726966742f61706974776973742d73736f2d6c61726176656c2d636c69656e742f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/Girift/apitwist-sso-laravel-client/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/a631cddd27d852b79f190bc644c00575ec145e3ce265d8f11eb2ec5b4d632733/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4769726966742f61706974776973742d73736f2d6c61726176656c2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Girift/apitwist-sso-laravel-client)

Client integration for ApiTwist SSO.

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

[](#installation)

Install the package via composer:

```
composer require girift/apitwist-sso-laravel-client
```

Add SSO config to your `.env` file:

```
SSO_CLIENT_ID=client_id
SSO_CLIENT_SECRET=client_secret
SSO_DOMAIN='https://sso.apitwist.com'
```

Add HasSsoTokens trait to your User model

```
// ...
use Girift\SSO\Traits\HasSsoTokens;

class User extends Authenticatable
{
    use HasSsoTokens;
    // ...
}
```

Add middlewares to your `app/Http/Kernel.php` file $routeMiddleware array:

```
protected $routeMiddleware = [
    // ...
    'sso.auth' => \Girift\SSO\Http\Middleware\SsoAuthenticate::class,
    'sso.api' => \Girift\SSO\Http\Middleware\SsoApiAuthenticate::class,
];
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="sso-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="sso-config"
```

This is the contents of the published config file:

```
return [
    'client_id' => env('SSO_CLIENT_ID'),
    'client_secret' => env('SSO_CLIENT_SECRET'),
    'redirect_url' => config('app.url') . '/sso/callback',
    'sso_domain' => env('SSO_DOMAIN', 'https://sso.apitwist.com'),
    'authorize_url' => config('sso.sso_domain').'/oauth/authorize',
    'api_url' => config('sso.sso_domain').'/oauth/token',
    'logout_url' => config('sso.sso_domain'). '/logout',
    'get_user_url' => config('sso.sso_domain').  '/api/user',
];
```

Usage
-----

[](#usage)

Use `sso.auth` along with `web` middleware in your `routes/web.php` file:

```
Route::middleware([ 'web', 'sso.auth' ])->get('/route', function () {
    // Your routes
});
```

If you see `Session store not set on request.` error, add theese middlewares in your `app/Http/Kernel.php` file $middleware array:

```
protected $middleware = [
    // ...
    \Illuminate\Session\Middleware\StartSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
];
```

Use named routes as authentication routes:

```
sso.login
sso.logout
```

Add `sso.loggedIn` named route to your home page:

```
Route::middleware([ 'web', 'sso.auth' ])->get('/home', function () {
    // Your home page
})->name('sso.loggedIn')->name('home');
```

Credits
-------

[](#credits)

- [Yasin BARAN](https://github.com/brnysn)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance76

Regular maintenance activity

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.6% 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 ~20 days

Recently: every ~105 days

Total

34

Last Release

374d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46607802?v=4)[girift](/maintainers/girift)[@Girift](https://github.com/Girift)

---

Top Contributors

[![brnysn](https://avatars.githubusercontent.com/u/31011885?v=4)](https://github.com/brnysn "brnysn (62 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![mesutdgn](https://avatars.githubusercontent.com/u/101476430?v=4)](https://github.com/mesutdgn "mesutdgn (14 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")

---

Tags

clientlaravelSSOapitwist

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/girift-apitwist-sso-laravel-client/health.svg)

```
[![Health](https://phpackages.com/badges/girift-apitwist-sso-laravel-client/health.svg)](https://phpackages.com/packages/girift-apitwist-sso-laravel-client)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M992](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[binaryk/laravel-restify

Laravel REST API helpers

677415.0k](/packages/binaryk-laravel-restify)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[aurorawebsoftware/aauth

Laravel Aauth

412.1k1](/packages/aurorawebsoftware-aauth)

PHPackages © 2026

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