PHPackages                             juststeveking/http-auth-strategies - 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. juststeveking/http-auth-strategies

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

juststeveking/http-auth-strategies
==================================

A simple PHP package that is used to create different Http Auth Headers

v1.2.0(5y ago)872.4k↓16.7%11MITPHPPHP ^7.4|^8.0

Since Oct 21Pushed 5y agoCompare

[ Source](https://github.com/JustSteveKing/http-auth-strategies)[ Packagist](https://packagist.org/packages/juststeveking/http-auth-strategies)[ GitHub Sponsors](https://github.com/JustSteveKing)[ RSS](/packages/juststeveking-http-auth-strategies/feed)WikiDiscussions main Synced 2d ago

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

Http Auth Strategies
====================

[](#http-auth-strategies)

[![Latest Version](https://camo.githubusercontent.com/f120faab9e2d77243e44cf5e688768ae8132c68c805176a6746fb676d14e8827/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75737473746576656b696e672f687474702d617574682d737472617465676965732e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/juststeveking/http-auth-strategies)[![PHP Version](https://camo.githubusercontent.com/a6a64787d36d97ece536d21b7efd9a5b61184f219d50ad7cdda246bba0bc5f9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a75737473746576656b696e672f687474702d617574682d737472617465676965732e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![tests](https://github.com/JustSteveKing/http-auth-strategies/workflows/tests/badge.svg)](https://github.com/JustSteveKing/http-auth-strategies/workflows/tests/badge.svg)[![Check & fix styling](https://github.com/JustSteveKing/http-auth-strategies/workflows/Code%20style/badge.svg)](https://github.com/JustSteveKing/http-auth-strategies/workflows/Code%20style/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/301e15ee4ba27796320ffc88a0ccadd954d2600ec9a7e7540fb321f4707ac48e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a75737473746576656b696e672f687474702d617574682d737472617465676965732e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6d656469756d76696f6c6574726564)](https://packagist.org/packages/juststeveking/http-auth-strategies)

A simple PHP package that is used to create different Http Auth Headers.

This is a simple to use library, to install - all you need to do is:

```
$ composer require juststeveking/http-auth-strategies
```

Then to use the library all you need to do is:

```
$strategy = new BasicStrategy(
    base64_encode("username:password")
);

// Get the Auth header as an array - passing through the required Authorization prefix
$strategy->getHeader('Bearer');
// ['Authorization' => 'Bearer dXNlcm5hbWU6cGFzc3dvcmQ=']
```

There is also a NullStrategy for when you want to follow a consistent pattern, but do not want to actually use any auth:

```
$strategy = new NullStrategy();

// Get the Auth header as an array - passing through the required Authorization prefix
$strategy->getHeader('Bearer');
// []
```

You can now also create your own custom header using the CustomStrategy, for when an API requires something specific that doesn't follow the typical pattern:

```
$strategy = new CustomStrategy(
    'your-api-key'
);

$strategy->setHeaderName('X-API-KEY');

// Get the Auth header as an array - passing through the required Authorization prefix
$strategy->getHeader('Bearer');
// ['X-API-KEY' => 'Bearer your-api-key']
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~23 days

Total

3

Last Release

2035d ago

PHP version history (2 changes)v1.0.0PHP ^7.4

v1.1.0PHP ^7.4|^8.0

### Community

Maintainers

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

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/juststeveking-http-auth-strategies/health.svg)

```
[![Health](https://phpackages.com/badges/juststeveking-http-auth-strategies/health.svg)](https://phpackages.com/packages/juststeveking-http-auth-strategies)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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