PHPackages                             ryanaby/lumen-auth-key - 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. ryanaby/lumen-auth-key

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

ryanaby/lumen-auth-key
======================

Authorize requests using auth key(s)

v1.0.0(6y ago)013MITPHP

Since Jun 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ryanaby/lumen-auth-key)[ Packagist](https://packagist.org/packages/ryanaby/lumen-auth-key)[ RSS](/packages/ryanaby-lumen-auth-key/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Lumen Auth Key
==============

[](#lumen-auth-key)

Manage api key access from .env file.

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

[](#installation)

Run `composer require ryanaby/lumen-auth-key`

In your `bootstrap/app.php` file, add the Lumen Auth Key provider to Register Service Providers blocks

```
// $app->register(App\Providers\AppServiceProvider::class);
// $app->register(App\Providers\AuthServiceProvider::class);
// $app->register(App\Providers\EventServiceProvider::class);
$app->register(Ryanaby\LumenAuthKey\Providers\AuthKeyServiceProvider::class);
```

Add Keys
--------

[](#add-keys)

Add your key on `.env` file, you can add more than one key using pipe `|` as separator.

`AUTH_KEY=y0ur5ecur3K3y|an0th3rSecur3K3y`

Usage
-----

[](#usage)

### Implementing Authorization

[](#implementing-authorization)

You can use middleware `auth.apikey` on your route.

```
$router->get('api/post/1', ['middleware' => ['auth.apikey'], function () {
    //
}]);
```

### Pass Authentication

[](#pass-authentication)

Request must have `X-auth-key` headers to have access your API endpoint.

```
X-auth-key: y0ur5ecur3K3y

```

Failed Authentication
---------------------

[](#failed-authentication)

The failed authentication will return 401 header

```
{
    "errors": [
        {
            "message": "Unauthorized Access"
        }
    ]
}
```

Lumen Auth Key package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

2206d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9303549?v=4)[Ryan Aby](/maintainers/ryanaby)[@ryanaby](https://github.com/ryanaby)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/ryanaby-lumen-auth-key/health.svg)

```
[![Health](https://phpackages.com/badges/ryanaby-lumen-auth-key/health.svg)](https://phpackages.com/packages/ryanaby-lumen-auth-key)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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