PHPackages                             mikechip/php-httpauth - 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. mikechip/php-httpauth

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

mikechip/php-httpauth
=====================

HTTP authorization wrapper for PHP 7

1.0.0(6y ago)034GPL-3.0-or-laterPHP

Since Oct 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mikechip/php-httpauth)[ Packagist](https://packagist.org/packages/mikechip/php-httpauth)[ RSS](/packages/mikechip-php-httpauth/feed)WikiDiscussions master Synced 5d ago

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

HTTP Auth Wrapper
=================

[](#http-auth-wrapper)

Library provides simple HTTP authentication

### Deprecated

[](#deprecated)

#### The library was made quite a while ago and may be out of date. Please make a fork if you want to use it.

[](#the-library-was-made-quite-a-while-ago-and-may-be-out-of-date-please-make-a-fork-if-you-want-to-use-it)

Installation
============

[](#installation)

Just download and include classes from `src` or use Composer:

`composer require mikechip/php-httpauth`

Sample use
==========

[](#sample-use)

```
    require_once('vendor/autoload.php');

    $auth = new Mike4ip\HttpAuth();
    $auth->addLogin('admin', 'test');
    $auth->addLogin('foo', 'bar');
    $auth->requireAuth();

    print('This is your hidden page');
```

Customization
=============

[](#customization)

```
    require_once('vendor/autoload.php');

    /*
     * HTTP Auth with customization
     */
    $auth = new Mike4ip\HttpAuth();
    $auth->setRealm('Pass login and password');

    // Set unauthorized callback
    $auth->onUnauthorized(function() {
        print("403 Forbidden");
        die;
    })->setCheckFunction(function($user, $pwd) {
        // List of logins => passwords
        $users = [
        'admin' => 'test',
        'foo' => 'bar'
        ];

        // Returns true if login and password matches
        return (isset($users[$user]) && $users[$user] === $pwd);
    })->requireAuth();

    print('This is your hidden page');
```

Feedback
========

[](#feedback)

Use **Issues** to contact me

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

2394d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b8c545e0b03157fdc20c82186661359a4761aa036bd076e4f17d76ee66e33a0?d=identicon)[bssth](/maintainers/bssth)

---

Top Contributors

[![bssth](https://avatars.githubusercontent.com/u/6750722?v=4)](https://github.com/bssth "bssth (3 commits)")

---

Tags

authauthorizationauthorization-middlewarehttphttp-authhttp-authenticationlibraryphpphp-samplephp7

### Embed Badge

![Health badge](/badges/mikechip-php-httpauth/health.svg)

```
[![Health](https://phpackages.com/badges/mikechip-php-httpauth/health.svg)](https://phpackages.com/packages/mikechip-php-httpauth)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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