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

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

codecollab/authentication
=========================

Authentication package of the CodeCollab project

1.0.0(9y ago)053See the LICENSE filePHPPHP ^7

Since Aug 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/CodeCollab/Authentication)[ Packagist](https://packagist.org/packages/codecollab/authentication)[ Docs](https://github.com/CodeCollab/Authentication)[ RSS](/packages/codecollab-authentication/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Authentication
==============

[](#authentication)

Authentication package of the CodeCollab project

[![Build Status](https://camo.githubusercontent.com/7fcf1e958cab3c850315ba18e44fcc60aa4bd06eda89d09de557fbe66206ea17/68747470733a2f2f7472617669732d63692e6f72672f436f6465436f6c6c61622f41757468656e7469636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/CodeCollab/Authentication) [![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](mit) [![Latest Stable Version](https://camo.githubusercontent.com/08ed0c875f71a0554e00d84cdd34445191ba09a8e9002e780bfc08d0b0ae89db/68747470733a2f2f706f7365722e707567782e6f72672f636f6465636f6c6c61622f61757468656e7469636174696f6e2f762f737461626c65)](https://packagist.org/packages/codecollab/authentication) [![Total Downloads](https://camo.githubusercontent.com/2c3401f7e10f9209db96eb8f6c70aecff2d352e531fdff4c203eaa7f57d99274/68747470733a2f2f706f7365722e707567782e6f72672f636f6465636f6c6c61622f61757468656e7469636174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/codecollab/authentication) [![Latest Unstable Version](https://camo.githubusercontent.com/9ce1da2fd35a402a4e3cb1a59e1fb9b374a78451b70b5f14434a26ea1f96fb7b/68747470733a2f2f706f7365722e707567782e6f72672f636f6465636f6c6c61622f61757468656e7469636174696f6e2f762f756e737461626c65)](https://packagist.org/packages/codecollab/authentication)

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

[](#requirements)

PHP7+

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

[](#installation)

Include the library in your project using composer:

```
{
    "require-dev": {
        "codecollab/authentication": "^1"
    }
}

```

Usage
-----

[](#usage)

Creating an instance of `User` requires an instance of `\CodeCollab\Http\Session\Session` from the [Http Library](https://github.com/CodeCollab/Http)

### User Authentication

[](#user-authentication)

The `logIn` function takes as arguments the password from the form, the password hash from the database and the user's information (to be persisted in Session).

```
$user = new User($session);
if ($user->logIn($password_from_form, $hash_from_db, $user_info_from_db)) {
    /** login successful **/
} else {
    /** login failed */
}

```

Assuming there's a "remember me" feature implemented a user can simply be logged in without comparing password hashes.

```
if ($user->logInRememberMe($user_info_from_db)) {
    /** login successful **/
} else {
    /** login failed */
}

```

After a successful login, the user's information can be retrieved depending on what `$user_info_from_db` (in above snippet) contained:

```
$user_name = $session->get('user_name');
$user_id = $session->get('user_id');

```

### Login Status

[](#login-status)

```
if ($user->isLoggedIn() {
    /** User is logged in **/
}

```

### Password Rehash

[](#password-rehash)

To check for and rehash (when needed) a logged in user's password:

```
if ($user->needsRehash($hash_from_db)) {
    $new_hash = $user->rehash($password_from_form);
    //save $new_hash to database
}

```

### Logout

[](#logout)

```
$user->logOut();

```

Contributing
------------

[](#contributing)

[How to contribute](https://github.com/CodeCollab/Authentication/blob/master/CONTRIBUTING.md)

License
-------

[](#license)

[MIT](http://spdx.org/licenses/MIT)

Security issues
---------------

[](#security-issues)

If you found a security issue please contact directly by mail instead of using the issue tracker at

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce6ea4ee501375bd1be563f6deed94e889d57d6134e98486208e5bcd14026ec2?d=identicon)[PeeHaa](/maintainers/PeeHaa)

---

Top Contributors

[![PeeHaa](https://avatars.githubusercontent.com/u/1330296?v=4)](https://github.com/PeeHaa "PeeHaa (24 commits)")[![iroegbu](https://avatars.githubusercontent.com/u/4746694?v=4)](https://github.com/iroegbu "iroegbu (1 commits)")

---

Tags

securityAuthenticationcodecollab

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codecollab-authentication/health.svg)

```
[![Health](https://phpackages.com/badges/codecollab-authentication/health.svg)](https://phpackages.com/packages/codecollab-authentication)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.1M62](/packages/hwi-oauth-bundle)[lusitanian/oauth

PHP 7.2 oAuth 1/2 Library

1.1k22.9M109](/packages/lusitanian-oauth)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

572612.5k1](/packages/scheb-2fa)[delight-im/auth

Authentication for PHP. Simple, lightweight and secure.

1.2k131.8k18](/packages/delight-im-auth)[jmikola/auto-login

Facilitates automatic login via a single token for Symfony's Security component.

99307.0k2](/packages/jmikola-auto-login)[jmikola/auto-login-bundle

Authenticate users in your Symfony app via a single query parameter (e.g. email and newsletter links).

84323.0k](/packages/jmikola-auto-login-bundle)

PHPackages © 2026

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