PHPackages                             pbergman/php-docker-token-auth - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. pbergman/php-docker-token-auth

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

pbergman/php-docker-token-auth
==============================

a light weight docker token authentication build in php

2.0.0(10y ago)6401MITPHPPHP &gt;=5.4.0

Since Jul 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/pbergman/php-docker-token-auth)[ Packagist](https://packagist.org/packages/pbergman/php-docker-token-auth)[ RSS](/packages/pbergman-php-docker-token-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

\##PHP docker registry 2 token authentication

This is a light weight docker token authentication build in php to the specs of the docs.

It can be used to validate push/pull and registration us users for you private registry.

\###Configuring

propertyrequiredtypedescriptionpublic\_keyyesstringthe private key, should be the content not file locationprivate\_keyyesstringthe public key, should be the content not file locationaudienceyesstringaudience that is registered in the registry (server name of registry)issueryesstringissuer that is registered in the registry (server name of this server)logger\_levelnostring|arraylog level\[s\] to display (example: \['error', 'info'\])logger\_filenostringlog file or fd for logging , if non is given it will use stdoutroute\_end\_pointnostringThe route endpoint to listen to, if non given it will default to /v2/token/signing\_algorithmnostringThe algoritm used for signing the token, supported: HS256, HS512, HS384, RS256 (but only RS256 tested :D)the config should be given as argument with the constructor:

```
$app = new DockerToken\Application([
    'public_key'   => dirname(__FILE__) . '/public.key',
    'private_key'  => dirname(__FILE__) . '/private.key',
    'audience'     => 'registry.docker.com',
    'issuer'       => 'auth.docker.com',
])

```

\###Validating

There are some listeners defined in src\\DockerToken\\Listener that can be used for validation (see) example.php or the tests.

To communicate between handlers you can use the (is|set)Access(Granted|Denied) methods (see LdapAuthListener or YamlAuthListener).

By default the flag is set to abstain en when finished when the flag is not granted it will see it as the authentiaction is not succesfull and throws a InvalidAccessException.

If you want to stop on success you can use the stopPropagation method because from the event because the set methods won`t do that. And on failure you can just call the InvalidAccessException that will resolve in a 401 status.

When using DockerToken\\Listener\\YamlAuthListener you also need symfony/yaml.

\###Running

php -S 127.0.0.1:9999 example.php

\###Keys

to generate keys, see:

```
php bin/CreateKeys.php

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

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

Total

4

Last Release

3722d ago

Major Versions

1.0.2 → 2.0.02016-03-09

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

tokendockerdocker authenticationdocker token

### Embed Badge

![Health badge](/badges/pbergman-php-docker-token-auth/health.svg)

```
[![Health](https://phpackages.com/badges/pbergman-php-docker-token-auth/health.svg)](https://phpackages.com/packages/pbergman-php-docker-token-auth)
```

###  Alternatives

[spatie/docker

Run a docker container in your PHPUnit tests

478120.2k12](/packages/spatie-docker)[ryoluo/sail-ssl

Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.

188672.6k2](/packages/ryoluo-sail-ssl)[aschmelyun/fleet

Run multiple Laravel Sail websites on your local environment

33269.5k](/packages/aschmelyun-fleet)[testcontainers/testcontainers

Testcontainers implementation in PHP

199184.7k17](/packages/testcontainers-testcontainers)[contributte/bootstrap

Extra contrib to nette/boostrap

111.5M3](/packages/contributte-bootstrap)[phpexperts/dockerize

The quickest and easiest way to switch any PHP app/library to use Docker.

7116.9k21](/packages/phpexperts-dockerize)

PHPackages © 2026

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