PHPackages                             alcalyn/authorization-header-fix - 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. [Security](/categories/security)
4. /
5. alcalyn/authorization-header-fix

ActiveLibrary[Security](/categories/security)

alcalyn/authorization-header-fix
================================

Simple listener that restore Authorization header in a Symfony Request under Apache.

1.0.1(9y ago)11.7k1MITPHPPHP &gt;=5.3

Since Jan 30Pushed 9y agoCompare

[ Source](https://github.com/alcalyn/authorization-header-fix)[ Packagist](https://packagist.org/packages/alcalyn/authorization-header-fix)[ Docs](https://github.com/alcalyn/authorization-header-fix)[ RSS](/packages/alcalyn-authorization-header-fix/feed)WikiDiscussions master Synced 2mo ago

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

Authorization header fix
========================

[](#authorization-header-fix)

Using a Symfony application on Apache, you get `null` when trying to get Authorization header with `$request->headers->get('Authorization');`.

The why is explained in [this Stackoverflow question](http://stackoverflow.com/questions/19443718/symfony-2-3-getrequest-headers-not-showing-authorization-bearer-token).

So if you don't want to patch your .htaccess, this library, inspired by [fschmengler's answer in this another SO question](http://stackoverflow.com/questions/11990388/request-headers-bag-is-missing-authorization-header-in-symfony-2), provides a listener which adds the Authorization header to a Symfony Request instance.

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

[](#installation)

### Download

[](#download)

Using Composer:

```
{
    "require": {
        "alcalyn/authorization-header-fix": "1.0.x"
    }
}
```

### Register listener

[](#register-listener)

To fix all Requests in a full stack Symfony app, register a listener like this:

```
# app/config/services.yml
services:
    acme.listeners.authorization_header_fix:
        class: Alcalyn\AuthorizationHeaderFix\AuthorizationHeaderFixListener
        tags:
            - { name: kernel.event_listener, event: kernel.request, priority: 10 }
```

Or using Silex:

```
$this->on('kernel.request', array(
    new Alcalyn\AuthorizationHeaderFix\AuthorizationHeaderFixListener(),
    'onKernelRequest'
), 10);
```

> Note:
>
> An higher priority is recommended to have the Authorization header available in others listeners.

License
-------

[](#license)

This library is under [MIT License](LICENSE).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Every ~308 days

Total

2

Last Release

3449d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17f0c4d65197a7aed6ecc8fdedd5a097c7238c9be19aca08c92c05d38fd8c29e?d=identicon)[alcalyn](/maintainers/alcalyn)

---

Top Contributors

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

---

Tags

phpsymfonyapache

### Embed Badge

![Health badge](/badges/alcalyn-authorization-header-fix/health.svg)

```
[![Health](https://phpackages.com/badges/alcalyn-authorization-header-fix/health.svg)](https://phpackages.com/packages/alcalyn-authorization-header-fix)
```

###  Alternatives

[rezzza/security-bundle

Signed requests check

1753.6k](/packages/rezzza-security-bundle)

PHPackages © 2026

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