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

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

keenops/auth-client
===================

OAuth2 SSO client SDK for integrating Laravel applications with the Central Authentication Server

1.0.1(3mo ago)01MITPHPPHP ^8.4

Since Mar 7Pushed 3mo agoCompare

[ Source](https://github.com/keenops/auth-client)[ Packagist](https://packagist.org/packages/keenops/auth-client)[ Docs](https://github.com/keenops/auth-client)[ RSS](/packages/keenops-auth-client/feed)WikiDiscussions main Synced 3w ago

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

Keenops Auth Client
===================

[](#keenops-auth-client)

OAuth2 SSO client SDK for integrating Laravel applications with the Central Authentication Server.

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

[](#installation)

Install via Composer:

```
composer require keenops/auth-client
```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=auth-client-config
```

Add the following environment variables to your `.env` file:

```
AUTH_SERVER_URL=https://your-auth-server.com
AUTH_CLIENT_ID=your-client-id
AUTH_CLIENT_SECRET=your-client-secret
AUTH_REDIRECT_URI=https://your-app.com/auth/callback
AUTH_SCOPES=read-user
AUTH_BACKCHANNEL_LOGOUT_SECRET=your-backchannel-secret
```

Usage
-----

[](#usage)

### SSO Authentication

[](#sso-authentication)

The package automatically registers the following routes:

- `GET /auth/redirect` - Redirect to auth server for login
- `GET /auth/callback` - Handle callback from auth server
- `POST /auth/logout` - Logout and revoke token
- `POST /auth/backchannel-logout` - Backchannel logout webhook

### Protecting Routes

[](#protecting-routes)

Use the provided middleware to protect routes:

```
// Require authentication
Route::middleware('auth.server')->group(function () {
    Route::get('/dashboard', DashboardController::class);
});

// Require specific permissions
Route::middleware(['auth.server', 'server.permission:manage_users'])->group(function () {
    Route::get('/admin/users', UserController::class);
});
```

### Accessing the Authenticated User

[](#accessing-the-authenticated-user)

```
use Illuminate\Support\Facades\Auth;

$user = Auth::guard('auth-server')->user();

// Check roles
if ($user->hasRole('admin')) {
    // ...
}

// Check permissions
if ($user->hasPermission('create_post')) {
    // ...
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Total

2

Last Release

97d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/979e7b5ad115c575c452f36f2316011ad49f9bb01cf45c5eb68d069af01ed64e?d=identicon)[kimwalu](/maintainers/kimwalu)

---

Top Contributors

[![keenops](https://avatars.githubusercontent.com/u/37520787?v=4)](https://github.com/keenops "keenops (3 commits)")

---

Tags

laravelSSOoauth2auth-clientkeenops

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M118](/packages/laravel-mcp)[webfox/laravel-xero-oauth2

A Laravel integration for Xero using the Oauth 2.0 spec

58488.6k2](/packages/webfox-laravel-xero-oauth2)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6753.6k5](/packages/hasinhayder-tyro)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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