PHPackages                             revenuefm/ssoguard - 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. revenuefm/ssoguard

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

revenuefm/ssoguard
==================

Laravel SSO package

v0.0.11(7y ago)733MITPHPPHP ^7.1.3

Since Oct 30Pushed 7y ago3 watchersCompare

[ Source](https://github.com/revenuefm/ssoguard)[ Packagist](https://packagist.org/packages/revenuefm/ssoguard)[ Docs](https://github.com/revenuefm/ssoguard)[ RSS](/packages/revenuefm-ssoguard/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

How to use Oauth2 access token of auth server to authorize users in resource/app server?
========================================================================================

[](#how-to-use-oauth2-access-token-of-auth-server-to-authorize-users-in-resourceapp-server)

This package is inspired by the issue founded on [on the StackOverflow](https://stackoverflow.com/questions/45389511/how-to-use-oauth2-access-token-of-auth-server-to-authorize-users-in-resource-app).

Package is aimed towards those who wants to implement the following situations

1. Auth server on Laravel (central user directory, OAuth2 using laravel/passport)
2. Resource servers on Laravel or Lumen (web apps, no user tables)
3. Client side JS app (Nuxt, React...)

*Note* worth noting that the User model must exists. You just need to change the connection to the database where the Auth server is.

What is the workflow?
---------------------

[](#what-is-the-workflow)

1. Login button on Client takes to auth server, oauth2 client is authorized by user and get auth code and redirect back to client.
2. Client then uses request to send data to resource server, with also providing the resource server the credentials.
3. Resource server with this guard authorizes the request so you can keep your API secure.

Instalation
-----------

[](#instalation)

Via composer

```
$ composer require revenuefm/ssoguard
```

After you installed the package publish the config

```
php artisan vendor:publish --tag=ssoguard-config
```

Open the config file and add the route to the `me` object where you are fetching the user object on Auth server. For example `https://your-domain.com/api/user`.

Using the guard
---------------

[](#using-the-guard)

Simple as is, change the API guard driver in your config `auth` to:

```
'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'ssoguard',
            'provider' => 'users',
        ],
    ],
```

After that you can use the standard API middleware

```
Route::get('my/secure/api-url', 'MyController@index')->middleware('auth:api');
```

The user object will be available from

```
$request->user()
```

as standard one.

If somebody wants to grow this package and make it better, please involve.

Best!

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

2751d ago

### Community

Maintainers

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

---

Top Contributors

[![gorankrgovic](https://avatars.githubusercontent.com/u/12137730?v=4)](https://github.com/gorankrgovic "gorankrgovic (2 commits)")

---

Tags

laravelSSOoauth

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/revenuefm-ssoguard/health.svg)

```
[![Health](https://phpackages.com/badges/revenuefm-ssoguard/health.svg)](https://phpackages.com/packages/revenuefm-ssoguard)
```

###  Alternatives

[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[authlete/authlete-laravel

Authlete Library for Laravel

4226.0k](/packages/authlete-authlete-laravel)

PHPackages © 2026

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