PHPackages                             osmo/auth - 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. osmo/auth

ActiveLibrary

osmo/auth
=========

Authentication for PHP 8. Secure and easy.

v1.0.0(3y ago)08MITPHPPHP &gt;=8.0

Since Mar 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mateoagudelo/osmo-auth)[ Packagist](https://packagist.org/packages/osmo/auth)[ RSS](/packages/osmo-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Osmo Auth
=========

[](#osmo-auth)

**Authentication for PHP 8. Secure and easy.**

[![Total Downloads](https://camo.githubusercontent.com/622a8e1dce0e59e86b2312ae19edc687a4f0985beb47b6463e0317adf3ff25de/68747470733a2f2f706f7365722e707567782e6f72672f6f736d6f2f617574682f642f746f74616c2e737667)](https://packagist.org/packages/osmo/auth)[![Latest Stable Version](https://camo.githubusercontent.com/9079208a6d086719cfa81d869edbecd79a3833bebef2e492cd94c694276b0ba0/68747470733a2f2f706f7365722e707567782e6f72672f6f736d6f2f617574682f762f737461626c652e737667)](https://packagist.org/packages/osmo/auth)[![License](https://camo.githubusercontent.com/f632285afb61a229b385d4b250b3c7d6d4ad92d259ef0ccf15372960fa2e1bf0/68747470733a2f2f706f7365722e707567782e6f72672f6f736d6f2f617574682f6c6963656e73652e737667)](https://packagist.org/packages/osmo/auth)

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

[](#requirements)

- PHP 8.0+ (`php 8`)
- PDO (PHP Data Objects) extension (`pdo`)
- MySQL 5.6+ **or** MariaDB 5.5.23+ **or** PostgreSQL 9.5.10+

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

[](#installation)

1. Include the library via Composer:

    ```
    $ composer require osmo/auth

    ```
2. Include the Composer autoloader:

    ```
    require __DIR__ . '/vendor/autoload.php';
    ```
3. Set up a database and create the required tables:

Usage
-----

[](#usage)

- [Connect to database](#connect-to-database)
- [Create and configure a new instance](#create-and-configure-a-new-instance)
- [Config login](#config-login)
- [Methods to verify passwords](#methods-to-verify-passwords)
- [Redirect on successful login](#redirect-on-successful-login)
- [Verify user login](#verify-user-login)
- [Clean user session](#clean-user-session)

### Connect to database

[](#connect-to-database)

The three required data are the name of the database, the username and password. If your table is not named users, please specify it in array or use the setTable method.

```
$con = new Osmo\Database([
    'username' => 'root',
    'database' => 'system',
    'password' => 'password'
  //'table'    => 'users_system'
]);
//Default value {users}
//$con->setTable('users_table');
```

### Create and configure a new instance

[](#create-and-configure-a-new-instance)

To configure the instance, you must pass two parameters, **$connection** and an **array\[\]** with the two fields in the database to be validated.

```
$auth = new Osmo\Auth($con, ['email', 'password']);
```

### Config login

[](#config-login)

In case the data is incorrect. The **make()** function will return a redirect to the same path where the **$\_POST** method was executed.

```
if ($auth->isPost()) {
    $auth->make($auth->inputEmailAddress(), $auth->input('password'), 'md5');
}
```

### Methods to verify passwords

[](#methods-to-verify-passwords)

- md5
- sha1
- crypt
- password\_verify (default verification)

```
$auth->make($auth->input('email'), $auth->input('password'), 'crypt');
```

To use the **password\_verify()** method, leave the third parameter blank.

```
$auth->make($auth->input('email'), $auth->input('password'));
```

### Redirect on successful login

[](#redirect-on-successful-login)

To redirect user, you need pass the callback function:

```
$auth->make($auth->inputEmailAddress(), $auth->input('password'), 'md5', function (){
    Osmo\Response::redirect('/');
});
```

### Verify user login

[](#verify-user-login)

You can check if a user is logged in, with the following function:

```
if(Osmo\SessionManager::auth()) {
    //
}
```

### Clean user session

[](#clean-user-session)

To clean up the sessions, you need to run the following function:

```
Osmo\SessionManager::destroy();
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

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

Every ~0 days

Total

2

Last Release

1167d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ab37c5f54503d1185b2750469997c1adbf34df17a34b09e2ec8a8cf5795567a?d=identicon)[mateoagudelo](/maintainers/mateoagudelo)

---

Top Contributors

[![mateoagudelo](https://avatars.githubusercontent.com/u/22106542?v=4)](https://github.com/mateoagudelo "mateoagudelo (7 commits)")

### Embed Badge

![Health badge](/badges/osmo-auth/health.svg)

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

PHPackages © 2026

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