PHPackages                             sokkian/simpleauth - 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. sokkian/simpleauth

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

sokkian/simpleauth
==================

A lightweight, secure PHP library for passwordless authentication using magic links

v1.0.0(5mo ago)00MITPHPPHP &gt;=7.4

Since Jan 15Pushed 5mo agoCompare

[ Source](https://github.com/sokkian/SimpleAuth)[ Packagist](https://packagist.org/packages/sokkian/simpleauth)[ Docs](https://github.com/sokkian/simpleauth)[ RSS](/packages/sokkian-simpleauth/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

SimpleAuth
==========

[](#simpleauth)

A lightweight, secure PHP library for passwordless authentication using magic links (one-time login tokens).

Project Status
--------------

[](#project-status)

⚠️ **Learning/educational project - not actively maintained.** Feel free to fork and adapt it for your needs.

Features
--------

[](#features)

- **Passwordless authentication**: Secure login via email magic links
- **Replay protection**: One-time use tokens with nonce validation
- **Clock skew tolerance**: Configurable grace period for time synchronization
- **Immutable result objects**: Type-safe error handling without exceptions
- **Internationalization**: Built-in support for multiple languages
- **Zero dependencies**: Pure PHP with no external libraries required
- **PSR-4 compatible**: Easy integration via autoloading

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- PDO extension with MySQL support
- MySQL 5.7+ or MariaDB 10.2+

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

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require sokkian/simpleauth
```

### Manual Installation

[](#manual-installation)

1. Download or clone this repository
2. Copy the `src/` directory to your project:

```
your-project/
├── src/
│   ├── Token.php
│   ├── Verifier.php
│   ├── Result.php
│   └── locales/
│       ├── en_US.php
│       ├── es_ES.php
│       └── it_IT.php
└── autoload.php

```

3. Create an autoloader file in your project root:

**autoload.php:**

```
