PHPackages                             dlundgren/watchtower - 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. dlundgren/watchtower

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

dlundgren/watchtower
====================

WatchTower Authentication

3211PHPCI failing

Since Jul 3Pushed 5y ago3 watchersCompare

[ Source](https://github.com/dlundgren/watchtower)[ Packagist](https://packagist.org/packages/dlundgren/watchtower)[ RSS](/packages/dlundgren-watchtower/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WatchTower
==========

[](#watchtower)

[![Travis CI](https://camo.githubusercontent.com/65491ee6f8328605446ab97e9666b5d10fdcd7ae07ceb136e7f95d2e3b970b7e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f646c756e646772656e2f7761746368746f7765722e706e67)](https://travis-ci.org/dlundgren/watchtower) [![Code Climate](https://camo.githubusercontent.com/0439489e1c4b02934c429d52dc3fc010906aeffd124f43febf5f0ccf57d3132a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f646c756e646772656e2f7761746368746f7765722f6261646765732f6770612e737667)](https://codeclimate.com/github/dlundgren/watchtower)

WatchTower is a library that allows for the identification and authentication of users using different backend providers and protocols.

WatchTower recognizes the following state of an identity:

- anonymous
- identified
- authenticated

It should be noted that identified is **NOT** the same thing as being authenticated.

PSR-1 and PSR-4 compliant.

Process
=======

[](#process)

Identify &gt; Authenticate &gt; Validate &gt; Authorize

Currently only Identify and Authenticate is currently working. Validate and Authorize may come later.

Identification and Authentication are implemented from the Sentry interface, which only knows how to discern the events given to it. The Sentries currently implemented only do one or the other and not both, at this time. As mentioned there are two events that are fired in the system Identify and Authenticate.

I chose not implement any other major Event Manager as WatchTower was not designed to be a complete event management system, but the sentries still needed contextual information and events seem most logical at the moment.

That said you attach any type of Sentry using the WatchTower::watch(Sentry) method.

Identification
--------------

[](#identification)

Identification happens when called, or directly before Authentication. Transparent identification, that using a session variable, or IP based, can be obtained by adding on of the stealth sentries to WatchTower first, then adding further identification sentries. thin two stages.

Authentication
--------------

[](#authentication)

Both Identity and Credential are required.

Session Support
---------------

[](#session-support)

WatchTower provides a PhpSession class for native php session storage. It is recommended to create a class that implements the Sentry interface and interacts with the frameworks session object in a similar fashion as the PhpSession class does with the native session.

Sentries
========

[](#sentries)

Transparent Identification
--------------------------

[](#transparent-identification)

These sentries are used behind the scenes in order to load an identity from the session, or another adapter that may check for the IP Address range to mark the session as a guest.

Identification
--------------

[](#identification-1)

These sentries are used during the identify() or authenticate() calls to identify the user.

Authentication
--------------

[](#authentication-1)

Authentication sentries validate the credentials and identity are valid.

Credits
=======

[](#credits)

This is based of the ZetaComponents Authentication components requirements documentation.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eb9bc1606754fee81247bf5d4a6a4d7fb7cce1b3769de69a345c5c8e120211e?d=identicon)[dlundgren](/maintainers/dlundgren)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dlundgren-watchtower/health.svg)

```
[![Health](https://phpackages.com/badges/dlundgren-watchtower/health.svg)](https://phpackages.com/packages/dlundgren-watchtower)
```

###  Alternatives

[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)[illuminate/auth

The Illuminate Auth package.

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

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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