PHPackages                             judasprabin/auth-manager - 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. judasprabin/auth-manager

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

judasprabin/auth-manager
========================

Auth0 wrapper for Lumen/Laravel

v10.0(2y ago)023MITPHPPHP ^8.1

Since Mar 6Pushed 2y agoCompare

[ Source](https://github.com/judasprabin/auth-manager)[ Packagist](https://packagist.org/packages/judasprabin/auth-manager)[ Docs](https://github.com/carsguide/auth-manager)[ RSS](/packages/judasprabin-auth-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (40)Used By (0)

auth-manager
============

[](#auth-manager)

Manages Lumen and Laravel Auth0 integration in microservices using PHP 8.0 version.

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

[](#installation)

Via composer

```
$ composer require carsguide/auth-manager

```

Environment settings .env file
------------------------------

[](#environment-settings-env-file)

```
AUTH0_AUDIENCE=
AUTH0_OAUTH_URL=
AUTH0_DOMAIN=
AUTH0_JWT_CLIENTID=
AUTH0_JWT_CLIENTSECRET=
AUTH0_ALGORITHM=

```

ValueWhat it isAUTH0\_AUDIENCEAuth0 audience/identifier of the API micro service verifying the tokenAUTH0\_OAUTH\_URLAuth0 URL to query to get a token from (the tenant)AUTH0\_DOMAINAuth0 domain of tenant (used during token verifcation)AUTH0\_JWT\_CLIENTIDAuth0 client ID of the micro service getting a tokenAUTH0\_JWT\_CLIENTSECRETAuth0 client secret of the micro service getting a tokenAUTH0\_ALGORITHMAlgorithm method, advise RS256 (default)### Registering service provider

[](#registering-service-provider)

#### Lumen

[](#lumen)

Add the following snippet to the `bootstrap/app.php` file under the register service providers section:

```
$app->register(Carsguide\Auth\Providers\AuthManagerServiceProvider::class);
```

#### Laravel

[](#laravel)

Add the following snippet to the `config/app.php` file under the register service providers section:

```
Carsguide\Auth\Providers\AuthManagerServiceProvider::class,
```

### Registering middleware

[](#registering-middleware)

To use token and scope validation register the middleware via routeMiddleware()

#### Lumen: bootstrap/app.php

[](#lumen-bootstrapappphp)

```
$app->routeMiddleware([
    'auth' => Carsguide\Auth\Middlewares\Auth0Middleware::class,
]);
```

#### Laravel: app/Http/kernel.php

[](#laravel-apphttpkernelphp)

```
protected $routeMiddleware = [
    'auth' => \Carsguide\Auth\Middlewares\Auth0Middleware::class,
];
```

Usage
-----

[](#usage)

### Generate JWT Token

[](#generate-jwt-token)

```
use Carsguide\Auth\AuthManager;
use GuzzleHttp\Client;

$auth = new AuthManager(new Client());
$auth = $auth->setAudience('foobar');
$auth->getToken();
```

Using `AuthManager` Facade:

```
use Carsguide\Auth\Facades\AuthManager;

AuthManager::setAudience('foobar')->getToken();
```

Cache JWT token:

```
 AuthManager::setAudience('foobar')
    // By default, JWT will cache for 50 minutes
    // If you need to override the default length,
    // pass minutes in cache(120) method.
    ->cache() // or ->cache($minutes = 120)
    ->getToken();
```

### Validate JWT Token / Scope Access

[](#validate-jwt-token--scope-access)

Each token is validated via middleware. You must call the middleware in routes or the controller to validate access. The middleware requires a scope be defined, nothing can be global.

```
$this->middleware('auth:listings:read');
```

Using routes file

```
$router->get('admin/profile', ['middleware' => 'auth:listings:read', function () {
    //
}]);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~85 days

Recently: every ~79 days

Total

26

Last Release

842d ago

Major Versions

v5.0.0 → v6.0.02021-07-01

v6.0.0 → v8.0.02021-10-01

v8.0.0 → v9.0.02022-12-12

v5.1.0 → v9.0.12023-03-14

v9.0.4 → v10.02024-01-23

PHP version history (7 changes)v1.0.0PHP &gt;=7.1.0

v3.0.0PHP ^7.2

v4.0.0PHP ^7.3

v6.0.0PHP ^7.4

v8.0.0PHP ^7.3||^8.0

v9.0.0PHP ^8.0

v10.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![skurzawa-cg](https://avatars.githubusercontent.com/u/101225694?v=4)](https://github.com/skurzawa-cg "skurzawa-cg (19 commits)")[![afaulds-carsguide](https://avatars.githubusercontent.com/u/86635652?v=4)](https://github.com/afaulds-carsguide "afaulds-carsguide (8 commits)")[![charbelcg](https://avatars.githubusercontent.com/u/55674628?v=4)](https://github.com/charbelcg "charbelcg (6 commits)")[![cg-rsands](https://avatars.githubusercontent.com/u/32720708?v=4)](https://github.com/cg-rsands "cg-rsands (5 commits)")[![Yama-Zhang](https://avatars.githubusercontent.com/u/47309316?v=4)](https://github.com/Yama-Zhang "Yama-Zhang (4 commits)")[![trothwell-carsguide](https://avatars.githubusercontent.com/u/31328217?v=4)](https://github.com/trothwell-carsguide "trothwell-carsguide (4 commits)")[![najjim](https://avatars.githubusercontent.com/u/38269907?v=4)](https://github.com/najjim "najjim (3 commits)")[![anam-hossain](https://avatars.githubusercontent.com/u/5017268?v=4)](https://github.com/anam-hossain "anam-hossain (3 commits)")[![carsguide-admin](https://avatars.githubusercontent.com/u/59550121?v=4)](https://github.com/carsguide-admin "carsguide-admin (1 commits)")[![Tom5om](https://avatars.githubusercontent.com/u/4668890?v=4)](https://github.com/Tom5om "Tom5om (1 commits)")[![judasprabin](https://avatars.githubusercontent.com/u/40344597?v=4)](https://github.com/judasprabin "judasprabin (1 commits)")

---

Tags

laravelauth0Lumen auth0

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/judasprabin-auth-manager/health.svg)

```
[![Health](https://phpackages.com/badges/judasprabin-auth-manager/health.svg)](https://phpackages.com/packages/judasprabin-auth-manager)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

2073.7k](/packages/kovah-laravel-socialite-oidc)

PHPackages © 2026

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