PHPackages                             activecollab/authentication - 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. activecollab/authentication

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

activecollab/authentication
===========================

Authenticate user

6.0.1(2y ago)166.4k↓34.3%5[3 PRs](https://github.com/activecollab/authentication/pulls)1MITPHPPHP &gt;=8.0

Since Nov 23Pushed 1mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (48)Used By (1)

Authentication Library
======================

[](#authentication-library)

[![Build Status](https://camo.githubusercontent.com/a10b106a66f3d86df1cdde6de53539aa6d2e21ee099049eb081528e96b5a41a2/68747470733a2f2f7472617669732d63692e6f72672f616374697665636f6c6c61622f61757468656e7469636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/activecollab/authentication)

Table of Contents:

- [Who are Authenticated Users](#who-are-authenticated-users)
    - [Accessing Users](#accessing-users)
- [Authorizers](#authorizers)
    - [Request Aware Authorizers](#request-aware-authorizers)
    - [Exception Aware Authorizers](#exception-aware-authorizers)
- [Transports](#transports)
- [Events](#events)
- [Authentication Middlewares](#authentication-middlewares)
- [Working with Passwords](#working-with-passwords)
    - [Hashing and Validating Passwords](#hashing-and-validating-passwords)
    - [Password Policy](#password-policy)
    - [Generating Random Passwords](#generating-random-passwords)
- [Login Policy](#login-policy)
- [To Do](#to-do)

Who are Authenticated Users?
----------------------------

[](#who-are-authenticated-users)

Authentication library builds on top of `activecollab/user` package. There are three types of visitors that we recognize:

1. Unidentified visitors - Visitors that we know nothing bout,
2. Identified visitors - People that we identified when they provided their email address,
3. Users with accounts - People with actual accounts in our application.

Only users with accounts in our application can be authenticated.

### Accessing Users

[](#accessing-users)

Write a class that implements `ActiveCollab\Authentication\AuthenticatedUser\RepositoryInterface` when integrating this package. Implementation of this interface will let the library find users by their ID and username:

```
