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

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

atellitech/auth-hyperf
======================

Auth module for Hyperf supporting SSO JWT verification and user synchronization.

v1.0.3(1mo ago)1154MITPHPPHP &gt;=8.3

Since Oct 12Pushed 1mo agoCompare

[ Source](https://github.com/AtelliTech/auth-hyperf)[ Packagist](https://packagist.org/packages/atellitech/auth-hyperf)[ RSS](/packages/atellitech-auth-hyperf/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (24)Versions (7)Used By (0)

🚀 atelliTech/auth-hyperf
========================

[](#-atellitechauth-hyperf)

**A flexible authentication library for Hyperf**, designed for stateless APIs with multiple authentication methods (e.g., Bearer Token and Query Parameter). Supports JWT verification via remote JWKS (SSO integration).

---

🧩 Requirements
--------------

[](#-requirements)

- PHP ≥ 8.3
- Hyperf ≥ 3.1
- Composer ≥ 2.0

---

⚙️ 1. Installation
------------------

[](#️-1-installation)

```
composer require atellitech/auth-hyperf
```

---

🧰 2. Configuration
------------------

[](#-2-configuration)

Publish the package configuration file:

```
php bin/hyperf.php vendor:publish atellitech/auth-hyperf
```

Then edit the file `config/autoload/auth.php`:

```
return [
    'jwt' => [
        'jwks_url' => 'https://sso.company.com/.well-known/jwks.json',
        'ttl' => 7200, // token lifetime in seconds
        'cache' => [
            'driver' => 'default', // use your application's cache driver
        ],
    ],
];
```

> 💡 `jwks_url` should point to your SSO provider’s JWKS endpoint.

---

👤 3. Implement `IdentityInterface`
----------------------------------

[](#-3-implement-identityinterface)

Create your application’s identity class implementing the interface:

```
