PHPackages                             innmind/http-authentication - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. innmind/http-authentication

ActiveLibrary[HTTP &amp; Networking](/categories/http)

innmind/http-authentication
===========================

HTTP authentication

6.0.0(2mo ago)02.1k2MITPHPPHP ~8.4CI passing

Since Aug 5Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Innmind/HttpAuthentication)[ Packagist](https://packagist.org/packages/innmind/http-authentication)[ Docs](http://github.com/Innmind/HttpAuthentication)[ RSS](/packages/innmind-http-authentication/feed)WikiDiscussions develop Synced 3d ago

READMEChangelog (3)Dependencies (4)Versions (18)Used By (2)

Http authentication
===================

[](#http-authentication)

[![Build Status](https://github.com/Innmind/HttpAuthentication/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Innmind/HttpAuthentication/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/e35f82c62b46ab73e6eb533694f0571fb9668142bf110e2613d4f63de0726fbe/68747470733a2f2f636f6465636f762e696f2f67682f496e6e6d696e642f4874747041757468656e7469636174696f6e2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Innmind/HttpAuthentication)[![Type Coverage](https://camo.githubusercontent.com/b77b8781c285c120a8506026870869965e27d9ef89f30cca291466901167f61e/68747470733a2f2f73686570686572642e6465762f6769746875622f496e6e6d696e642f4874747041757468656e7469636174696f6e2f636f7665726167652e737667)](https://shepherd.dev/github/Innmind/HttpAuthentication)

Simple tool to authenticate a request.

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

[](#installation)

```
composer require innmind/http-authentication
```

Usage
-----

[](#usage)

```
use Innmind\HttpAuthentication\ViaBasicAuthorization;
use Innmind\Router\{
    Router,
    Component,
    Collect,
    Handle,
};
use Innmind\Http\{
    ServerRequest,
    Response,
};
use Innmind\Immutable\Attempt;

function login(string $user, string $password): Attempt
{
    // find the user
}

$router = Router::of(
    Component::of(ViaBasicAuthorization::of(
        static fn(string $user, string $password) => login($user, $password),
    ))
        ->map(Collect::of('user'))
        ->pipe(Handle::of(
            static fn(ServerRequest $request, mixed $user) => Attempt::result(
                Response::of(
                    // build response
                ),
            ),
        ));
);

$response = $router(/* an instance of Innmind\Http\ServerRequest */)->unwrap();
```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance89

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 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

Every ~211 days

Recently: every ~456 days

Total

14

Last Release

89d ago

Major Versions

1.4.0 → 2.0.02020-03-01

2.1.0 → 3.0.02023-04-10

3.0.0 → 4.0.02023-11-01

4.0.0 → 5.0.02025-08-24

5.0.0 → 6.0.02026-02-15

PHP version history (6 changes)1.0.0PHP ~7.2

2.0.0PHP ~7.4

2.1.0PHP ~7.4|~8.0

3.0.0PHP ~8.1

4.0.0PHP ~8.2

6.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (91 commits)")

---

Tags

httpAuthentication

### Embed Badge

![Health badge](/badges/innmind-http-authentication/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-http-authentication/health.svg)](https://phpackages.com/packages/innmind-http-authentication)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[league/uri

URI manipulation library

1.1k206.4M277](/packages/league-uri)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[laminas/laminas-diactoros

PSR HTTP Message implementations

546105.8M965](/packages/laminas-laminas-diactoros)[intervention/httpauth

HTTP Authentication Management for PHP

8712.3M4](/packages/intervention-httpauth)

PHPackages © 2026

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