PHPackages                             byjg/authuser - 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. byjg/authuser

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

byjg/authuser
=============

A simple and customizable library for user authentication in PHP applications using a clean repository and service layer architecture.

6.0.0(5mo ago)310.8k↓40.9%2MITPHPPHP &gt;=8.3 &lt;8.6CI passing

Since Sep 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/byjg/php-authuser)[ Packagist](https://packagist.org/packages/byjg/authuser)[ GitHub Sponsors](https://github.com/byjg)[ RSS](/packages/byjg-authuser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (19)Used By (2)

   sidebar\_key authuser   tags    php

 authentication

    User Authentication
===================

[](#user-authentication)

A simple and customizable library for user authentication in PHP applications using a clean repository and service layer architecture.

[![Sponsor](https://camo.githubusercontent.com/fab14b7f7f475072ada0473f193d6f322561fd4a2958e0cc89910d053347cf27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d2532336561346161613f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d306431313137)](https://github.com/sponsors/byjg)[![Build Status](https://github.com/byjg/php-authuser/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/byjg/php-authuser/actions/workflows/phpunit.yml)[![Opensource ByJG](https://camo.githubusercontent.com/425c1bbccc0f292bf4d20569ae74a6b2e384fd648f1af8911bc61de9a8dcfc0b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f70656e736f757263652d62796a672d737563636573732e737667)](http://opensource.byjg.com)[![GitHub source](https://camo.githubusercontent.com/88e61eb211719144efdd570290a0456b6e13099c2df8d973f1bb43fe33bf0039/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769746875622d736f757263652d696e666f726d6174696f6e616c3f6c6f676f3d676974687562)](https://github.com/byjg/php-authuser/)[![GitHub license](https://camo.githubusercontent.com/7de10dbfabd2acb347e3f073ef99d1278449cec24a6bdd00b2c0dc26b0e4e061/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f62796a672f7068702d61757468757365722e737667)](https://opensource.byjg.com/license)[![GitHub release](https://camo.githubusercontent.com/55f3b92bb78b6f385bce2b7a10bf05bb71e3cecebee0f7070d73d52b31534209/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f62796a672f7068702d61757468757365722e737667)](https://github.com/byjg/php-authuser/releases/)

The main purpose is to handle all complexity of user validation, authentication, properties management, and access tokens, abstracting the database layer. This class can persist user data into session (or file, memcache, etc.) between requests.

Documentation
-------------

[](#documentation)

- [Getting Started](docs/getting-started.md)
- [Installation](docs/installation.md)
- [User Management](docs/user-management.md)
- [Authentication](docs/authentication.md)
- [Session Context](docs/session-context.md)
- [User Properties](docs/user-properties.md)
- [Database Storage](docs/database-storage.md)
- [Password Validation](docs/password-validation.md)
- [JWT Tokens](docs/jwt-tokens.md)
- [Custom Fields](docs/custom-fields.md)
- [Mappers](docs/mappers.md)
- [Examples](docs/examples.md)

Quick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
composer require byjg/authuser
```

See [Installation Guide](docs/installation.md) for detailed setup instructions and requirements.

Basic Usage
-----------

[](#basic-usage)

```
