PHPackages                             ecmxperts/lumenoauth2 - 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. ecmxperts/lumenoauth2

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

ecmxperts/lumenoauth2
=====================

The EcmXperts LumenOauth2 package

0.3.2(4y ago)0185MITPHPPHP ^7.2

Since Jul 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/MarkV28/lumenoauth2)[ Packagist](https://packagist.org/packages/ecmxperts/lumenoauth2)[ RSS](/packages/ecmxperts-lumenoauth2/feed)WikiDiscussions main Synced 3w ago

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

LumenOauth2
===========

[](#lumenoauth2)

Introduction
------------

[](#introduction)

Lumen Oauth2 provides a simple API to authenticate your Lumen api with an Openid/Oauth2 server.

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

[](#installation)

### Via composer

[](#via-composer)

Run `composer require ecmxperts/lumenoauth2 0.*`

Usage
-----

[](#usage)

In your `.env` add the following Environment Variable

```
IDENTITY_URL=openid/oauth2 server address

```

In your `app\Providers\AuthServiceProvider.php` inside the boot method add the following lines

```
$this->app['auth']->viaRequest('api', function ($request) {
    if (($token = $request->bearerToken()) != null) {
        try {
            return LumenOauth2::setProviderUrl(env('IDENTITY_URL'))
                ->setAudience('expected audience')
                ->authenticate($token);
        } catch (LumenOauth2Exception $e) {
            Log::error($e, ['exception' => $e]);
        }
    }
});

```

See [Lumen Authentication](https://lumen.laravel.com/docs/6.x/authentication) for the rest on Authentication

The following methods can be used to access the authenticated user properties:

- The global identifier for the user.

```
    $userGuid = Auth::user()->guid();

    $userGuid = $request->user()->guid();

```

- The firstname for the user.

```
    $firstname = Auth::user()->firstname();

    $firstname = $request->user()->firstname();

```

- The surname for the user.

```
    $surname = Auth::user()->surname();

    $surname = $request->user()->surname();

```

- The fullname for the user.

```
    $fullname = Auth::user()->fullname();

    $fullname = $request->user()->fullname();

```

- The tenant global identifier for the user.

```
    $tenant = Auth::user()->tenant();

    $tenant = $request->user()->tenant();

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

1822d ago

### Community

Maintainers

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

---

Top Contributors

[![MarkV28](https://avatars.githubusercontent.com/u/7251033?v=4)](https://github.com/MarkV28 "MarkV28 (46 commits)")

### Embed Badge

![Health badge](/badges/ecmxperts-lumenoauth2/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[google/auth

Google Auth Library for PHP

1.4k294.2M218](/packages/google-auth)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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