PHPackages                             cegrent/auth0-laravel - 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. cegrent/auth0-laravel

ActiveLibrary

cegrent/auth0-laravel
=====================

Laravel plugin that helps authenticate with the auth0 service

6.2.0(1y ago)0178MITPHP ^7.3 | ^8.0

Since Apr 21Pushed 1y agoCompare

[ Source](https://github.com/cegrent/laravel-auth0)[ Packagist](https://packagist.org/packages/cegrent/auth0-laravel)[ RSS](/packages/cegrent-auth0-laravel/feed)WikiDiscussions change-user-model Synced 3d ago

READMEChangelog (1)Dependencies (9)Versions (48)Used By (0)

Laravel Auth0 Plugin
====================

[](#laravel-auth0-plugin)

This plugin helps you integrate your [Laravel](https://laravel.com/) WebApp with [Auth0](https://auth0.com/) to achieve Single Sign On with a few simple steps.

- Master targets Laravel 6 compatibility.
- The 3.x branch (not maintained) targets Laravel 5.2 compatibility.
- The 2.x branch (not maintained) targets Laravel 5.0 and 5.1 compatibility.
- If you are working with an older version (Laravel 4.x), use version 1.0.\* (not maintained)

[![CircleCI](https://camo.githubusercontent.com/6e9bb9c9030dd39e726f26b535dc5838fb96d20fce7d18141877cd3df199781f/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f70726f6a6563742f6769746875622f61757468302f6c61726176656c2d61757468302f6d61737465722e737667)](https://circleci.com/gh/auth0/laravel-auth0)[![Latest Stable Version](https://camo.githubusercontent.com/a1f4de4d59c0a951a9a282fc847931142580e4976c1bb749c9001408bb83b351/68747470733a2f2f706f7365722e707567782e6f72672f61757468302f6c6f67696e2f762f737461626c65)](https://packagist.org/packages/auth0/login)[![License](https://camo.githubusercontent.com/81ea1ea07b20e1a8868f724778b658988e03ee96e515c1fc0b091b23d454b28a/68747470733a2f2f706f7365722e707567782e6f72672f61757468302f6c6f67696e2f6c6963656e7365)](https://packagist.org/packages/auth0/login)[![Total Downloads](https://camo.githubusercontent.com/e2e2d347837863fcb44ce3cc5eb14358066c1872ce5636d5577a68950e39fe21/68747470733a2f2f706f7365722e707567782e6f72672f61757468302f6c6f67696e2f646f776e6c6f616473)](https://packagist.org/packages/auth0/login)

Documentation
-------------

[](#documentation)

Please see the [Laravel webapp quickstart](https://auth0.com/docs/quickstart/webapp/laravel) for a complete guide on how to install this in an existing project or to download a pre-configured sample project. Additional documentation on specific scenarios is below.

### Setting up a JWKs cache

[](#setting-up-a-jwks-cache)

In the `register` method of your `AppServiceProvider` add:

```
// app/Providers/AppServiceProvider.php
use Illuminate\Support\Facades\Cache;
// ...
    public function register()
    {
        // ...
        $this->app->bind(
            '\Auth0\SDK\Helpers\Cache\CacheHandler',
            function() {
                static $cacheWrapper = null;
                if ($cacheWrapper === null) {
                $cache = Cache::store();
                $cacheWrapper = new LaravelCacheWrapper($cache);
            }
            return $cacheWrapper;
        });
    }
```

You can implement your own cache strategy by creating a new class that implements the `Auth0\SDK\Helpers\Cache\CacheHandler` contract, or just use the cache strategy you want by picking that store with `Cache::store('your_store_name')`;

### Storing users in your database

[](#storing-users-in-your-database)

You can customize the way you handle the users in your application by creating your own `UserRepository`. This class should implement the `Auth0\Login\Contract\Auth0UserRepository` contract. Please see the [Custom User Handling section of the Laravel Quickstart](https://auth0.com/docs/quickstart/webapp/laravel#optional-custom-user-handling) for the latest example.

### Using auth guard

[](#using-auth-guard)

To protect APIs using an access token generated by Auth0, there is an `auth0` API guard provided ([Laravel documentation on guards](https://laravel.com/docs/7.x/authentication#adding-custom-guards)). To use this guard, add it to `config/auth.php` with the driver `auth0`:

```
'guards' => [
    ...
    'auth0' => [
        'driver' => 'auth0',
        'provider' => 'auth0',
    ],
],

'providers' => [
    ...
    'auth0' => [
        'driver' => 'auth0',
    ],
],

```

Once that has been added, add the guard to the middleware of any API route and check authentication during the request:

```
// get user
auth('auth0')->user();
// check if logged in
auth('auth0')->check();
// protect routes via middleware use
Route::group(['middleware' => 'auth:auth0'], function () {});

```

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

[](#installation)

Install this plugin into a new or existing project using [Composer](https://getcomposer.org/doc/00-intro.md):

```
$ composer require auth0/login:"~5.0"
```

Additional steps to install can be found in the [quickstart](https://auth0.com/docs/quickstart/webapp/laravel#integrate-auth0-in-your-application).

Contributing
------------

[](#contributing)

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

- [Auth0's Contribution guidelines](https://github.com/auth0/.github/blob/master/CONTRIBUTING.md)
- [Auth0's Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)

Support + Feedback
------------------

[](#support--feedback)

Include information on how to get support. Consider adding:

- Use [Community](https://community.auth0.com/tags/laravel) for usage, questions, specific cases
- Use [Issues](https://github.com/auth0/laravel-auth0/issues) for code-level support

What is Auth0?
--------------

[](#what-is-auth0)

Auth0 helps you to easily:

- implement authentication with multiple identity providers, including social (e.g., Google, Facebook, Microsoft, LinkedIn, GitHub, Twitter, etc), or enterprise (e.g., Windows Azure AD, Google Apps, Active Directory, ADFS, SAML, etc.)
- log in users with username/password databases, passwordless, or multi-factor authentication
- link multiple user accounts together
- generate signed JSON Web Tokens to authorize your API calls and flow the user identity securely
- access demographics and analytics detailing how, when, and where users are logging in
- enrich user profiles from other data sources using customizable JavaScript rules

[Why Auth0?](https://auth0.com/why-auth0)

License
-------

[](#license)

The Auth0 Laravel Login plugin is licensed under MIT - [LICENSE](LICENSE.txt)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance45

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 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 ~90 days

Recently: every ~451 days

Total

45

Last Release

433d ago

Major Versions

2.2.0 → 3.0.02016-01-06

2.3.1 → 3.1.02016-05-02

3.2.1 → 4.0.02016-09-15

4.0.8 → 5.0.02017-02-22

5.4.0 → 6.0.02020-04-10

PHP version history (5 changes)1.0.3PHP &gt;=5.3.0

5.2.0PHP &gt;=5.4.0

5.3.1PHP &gt;=5.5.0

6.0.0PHP ^7.1

6.2.0PHP ^7.3 | ^8.0

### Community

Maintainers

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

---

Top Contributors

[![glena](https://avatars.githubusercontent.com/u/5647310?v=4)](https://github.com/glena "glena (96 commits)")[![joshcanhelp](https://avatars.githubusercontent.com/u/855223?v=4)](https://github.com/joshcanhelp "joshcanhelp (27 commits)")[![hrajchert](https://avatars.githubusercontent.com/u/2634059?v=4)](https://github.com/hrajchert "hrajchert (14 commits)")[![mgonto](https://avatars.githubusercontent.com/u/723723?v=4)](https://github.com/mgonto "mgonto (12 commits)")[![nstapelbroek](https://avatars.githubusercontent.com/u/3368018?v=4)](https://github.com/nstapelbroek "nstapelbroek (10 commits)")[![lbalmaceda](https://avatars.githubusercontent.com/u/3900123?v=4)](https://github.com/lbalmaceda "lbalmaceda (8 commits)")[![seanmangar](https://avatars.githubusercontent.com/u/6080053?v=4)](https://github.com/seanmangar "seanmangar (6 commits)")[![damieng](https://avatars.githubusercontent.com/u/118951?v=4)](https://github.com/damieng "damieng (5 commits)")[![thijsvdanker](https://avatars.githubusercontent.com/u/429548?v=4)](https://github.com/thijsvdanker "thijsvdanker (4 commits)")[![cocojoe](https://avatars.githubusercontent.com/u/928115?v=4)](https://github.com/cocojoe "cocojoe (4 commits)")[![ntotten](https://avatars.githubusercontent.com/u/282782?v=4)](https://github.com/ntotten "ntotten (4 commits)")[![Annyv2](https://avatars.githubusercontent.com/u/5016479?v=4)](https://github.com/Annyv2 "Annyv2 (3 commits)")[![adamgoose](https://avatars.githubusercontent.com/u/611068?v=4)](https://github.com/adamgoose "adamgoose (2 commits)")[![benjaminbowles](https://avatars.githubusercontent.com/u/245569?v=4)](https://github.com/benjaminbowles "benjaminbowles (2 commits)")[![devjack](https://avatars.githubusercontent.com/u/3516066?v=4)](https://github.com/devjack "devjack (2 commits)")[![dmyers](https://avatars.githubusercontent.com/u/207171?v=4)](https://github.com/dmyers "dmyers (2 commits)")[![FreekVR](https://avatars.githubusercontent.com/u/417416?v=4)](https://github.com/FreekVR "FreekVR (2 commits)")[![irieznykov](https://avatars.githubusercontent.com/u/48024435?v=4)](https://github.com/irieznykov "irieznykov (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (2 commits)")[![PhillippOhlandt](https://avatars.githubusercontent.com/u/3123549?v=4)](https://github.com/PhillippOhlandt "PhillippOhlandt (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cegrent-auth0-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/cegrent-auth0-laravel/health.svg)](https://phpackages.com/packages/cegrent-auth0-laravel)
```

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)

PHPackages © 2026

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