PHPackages                             holyhabit/oauth - 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. holyhabit/oauth

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

holyhabit/oauth
===============

Simple and secure OAuth integration for PHP projects

v0.1.0-alpha(1y ago)00MITPHPPHP ^8.1CI failing

Since Jul 3Pushed 1y agoCompare

[ Source](https://github.com/jagers-ai/oauth)[ Packagist](https://packagist.org/packages/holyhabit/oauth)[ RSS](/packages/holyhabit-oauth/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (11)Versions (2)Used By (0)

HolyOAuth
=========

[](#holyoauth)

Simple and secure OAuth integration for PHP projects with PKCE support and ID token validation.

Quick Start (10 lines)
----------------------

[](#quick-start-10-lines)

```
composer require holyhabit/oauth:^0.1
```

```
use HolyOAuth\Core\OAuthManager;
use HolyOAuth\Providers\GoogleProvider;
use HolyOAuth\Storage\SessionStorage;

$storage = new SessionStorage();
$manager = new OAuthManager($storage);
$manager->registerProvider('google', GoogleProvider::create('client-id', 'secret', 'redirect-uri'));

// Login: header('Location: ' . $manager->getAuthorizationUrl('google'));
// Callback: $user = $manager->handleCallback('google', $_GET['code'], $_GET['state']);
```

Features
--------

[](#features)

- 🔒 **PKCE (S256)** - Enhanced security with Proof Key for Code Exchange
- 🛡️ **ID Token Validation** - Verify JWT tokens from OAuth providers
- 🔑 **CSRF Protection** - 128-bit state tokens
- 📦 **PSR Compliant** - PSR-4, PSR-12, PSR-18
- 🚀 **Easy Integration** - Works with any PHP framework
- ✅ **Well Tested** - Unit tests with mock HTTP clients

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

[](#installation)

```
composer require holyhabit/oauth:^0.1.0-alpha
```

Basic Example
-------------

[](#basic-example)

See [examples/basic](examples/basic) for a complete working example.

```
