hercdottech / stateless-token
A composer package to generate and validate stateless tokens
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/hercdottech/stateless-token
Requires
- php: ^8.3
- ext-hash: *
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- phpunit/phpunit: ^12.1
README
The hercdottech/stateless-token PHP package provides a way to generate and validate stateless tokens. Without
making use of a database, files, or any other kind of state, this package relies on a private key known only to the
server and an array of clues to validate the tokens.
Due to the stateless nature of this package, it cannot be used to protect against replay attacks.
Requirements
- PHP 8.3 or later
- PHP JSON Extension (installed by default)
- PHP Hash Extension (installed by default)
Features
- Generate secure tokens using sha256 algorithm HMAC hash.
- The expiration period of each token is configurable, set to 1 hour by default.
- The generated tokens are URL-safe and can be used with GET requests.
Installation
Run the following command in your terminal:
composer require hercdottech/stateless-token