PHPackages                             cac/api-token - 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. cac/api-token

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

cac/api-token
=============

API Token creator and validator

210PHP

Since Apr 28Pushed 13y ago1 watchersCompare

[ Source](https://github.com/CrazyAwesomeCompany/api-token)[ Packagist](https://packagist.org/packages/cac/api-token)[ RSS](/packages/cac-api-token/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Crazy Awesome API Token
=======================

[](#crazy-awesome-api-token)

Create and validate API tokens

In this example we create a new token based on the user ID

```
# ... user is logged in with user id 123
use CAC\Component\Token\Encrypt\McryptToken;
use CAC\Component\Token\TokenGenerator;

$tokenEncrypter = new McryptToken();
$tokenGenerator = new TokenGenerator($tokenEncrypter, 's3cr3tKeY$$');

$token = $tokenGenerator->createToken(123);

```

Get the user ID back from the token

```
$userId = $tokenGenerator->validateToken($token);
# $userId = 123

```

When an invalid token is given the `validateToken` method returns `FALSE`

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1029199?v=4)[Nick de Groot](/maintainers/ngroot)[@ngroot](https://github.com/ngroot)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/cac-api-token/health.svg)

```
[![Health](https://phpackages.com/badges/cac-api-token/health.svg)](https://phpackages.com/packages/cac-api-token)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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