PHPackages                             wscore/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. wscore/auth

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

wscore/auth
===========

a simple authenticate package.

0.4.1(5y ago)024[2 issues](https://github.com/WScore/Auth/issues)MITPHP

Since Mar 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/WScore/Auth)[ Packagist](https://packagist.org/packages/wscore/auth)[ RSS](/packages/wscore-auth/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

WScore.Auth
===========

[](#wscoreauth)

A simple authentication package.

### License

[](#license)

MIT License

### PSR

[](#psr)

PSR-1, PSR-2, and PSR-4.

### Installation

[](#installation)

```
composer require "wscore/auth: ^0.3"
```

Getting Started
---------------

[](#getting-started)

`Auth` requires `UserProviderInterface` object to access to user information.

```
$auth = new Auth(new UserProvider);
```

To authenticate a user, get user-id (`$id`) and user-password (`$pw`) from a login form, and

```
if ($auth->login($id, $pw)) {
    echo 'login success!';
}
```

to check for login later on,

```
$auth->isLogin();
```

You can retrieve login information such as;

```
$user = $auth->getLoginUser(); // login user entity returned by UserProvider's getUserInfo() method.
$mail = $auth->getLoginId(); // get login user's id. maybe an email?
```

### Force Login

[](#force-login)

`forceLogin` method allow to login as a user *without* a password, for purposes, such as system administration.

```
$auth->forceLogin($id);
```

then, you can check if the login is force or not.

```
$auth->isLoginBy(Auth::BY_FORCED); // check for login method.
```

UserProvider
------------

[](#userprovider)

The `Auth` requires a user provider object implementing `UserProviderInterface`. The interface has 4 APIs; that are

- `getUserById($id)`: for retrieving a user entity for `$id` (a login user).
- `getUserByIdAndPw($id, $pw)`: for retrieving a user entity for `$id` and valid `$pw`.
- `getUserType()`: for retrieving a key-string to identify the user-provider.

Remember-Me Option
------------------

[](#remember-me-option)

To use Remember-me option, use `setRememberMe` method, as

```
$auth = new Auth(...);
$auth->setRememberMe(new MyRememberMe());
```

- `$remember` object implementing `RememberMeInterface`,
- `RememberCookie` object,

then, when login, supply 3rd argument when `login` as

```
$auth->login($id, $pw, true);
```

to save the `$id` and a remember-me token to cookie if login is successful.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~415 days

Recently: every ~423 days

Total

6

Last Release

2007d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ed783829e6fa0bd4b0def8c04ccfdfb2fc99f9e61e4a9470acad9e5abc5fcac?d=identicon)[asaokamei](/maintainers/asaokamei)

---

Top Contributors

[![asaokamei](https://avatars.githubusercontent.com/u/747030?v=4)](https://github.com/asaokamei "asaokamei (39 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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