PHPackages                             hskrasek/laravel-zero-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. hskrasek/laravel-zero-oauth

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

hskrasek/laravel-zero-oauth
===========================

Easily add OAuth2 authentication to your Laravel Zero application.

v0.0.3(2y ago)07[2 issues](https://github.com/hskrasek/laravel-zero-oauth/issues)MITPHPPHP ^8.3

Since Feb 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hskrasek/laravel-zero-oauth)[ Packagist](https://packagist.org/packages/hskrasek/laravel-zero-oauth)[ RSS](/packages/hskrasek-laravel-zero-oauth/feed)WikiDiscussions main Synced yesterday

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

Laravel Zero OAuth
==================

[](#laravel-zero-oauth)

[![example workflow](https://github.com/hskrasek/laravel-zero-oauth/actions/workflows/tests.yml/badge.svg)](https://github.com/hskrasek/laravel-zero-oauth/actions)[![Latest Stable Version](https://camo.githubusercontent.com/63f8dde29119779ca649cbf09d480ced4c9df5b35d6f262a31a6687553568db1/68747470733a2f2f706f7365722e707567782e6f72672f68736b726173656b2f6c61726176656c2d7a65726f2d6f617574682f76)](//packagist.org/packages/hskrasek/laravel-zero-oauth)[![Total Downloads](https://camo.githubusercontent.com/e8796771b8e76db8bcd6cef95a43b6a094bf13c1414d1c9b3ac3e3c0c4815a4d/68747470733a2f2f706f7365722e707567782e6f72672f68736b726173656b2f6c61726176656c2d7a65726f2d6f617574682f646f776e6c6f616473)](//packagist.org/packages/hskrasek/laravel-zero-oauth)[![PHP Version Require](https://camo.githubusercontent.com/7840627087afc5044b9993e1f1787590c1197600e36ff68243d98e0b6b5e69a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f68736b726173656b2f6c61726176656c2d7a65726f2d6f617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hskrasek/laravel-zero-oauth)[![GitHub stars](https://camo.githubusercontent.com/9dc9ddff62b04ab7022c2c47c5bdb03c256ee10179ce8c2b932ed778e214b115/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f68736b726173656b2f6c61726176656c2d7a65726f2d6f617574682e7376673f7374796c653d666c61742d737175617265)](https://github.com/hskrasek/laravel-zero-oauth)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/hskrasek/laravel-zero-oauth/blob/master/LICENSE)

Introduction
------------

[](#introduction)

**Laravel Zero OAuth** is a library aimed at adding OAuth 2.0 authentication to your [Laravel Zero](http://laravel-zero.com) application, leveraging [The PHP League's OAuth 2.0 Client](https://oauth2-client.thephpleague.com/) library.

Laravel Zero was created by Nuno [Nuno Maduro](https://github.com/nunomaduro) and [Owen Voke](https://github.com/owenvoke), and is a micro-framework that provides an elegant starting point for your console application. It's a customized version of Laravel optimized for building command-line applications.

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

[](#installation)

- To get started install it using composer:

```
composer require hskrasek/laravel-zero-oauth
```

- Then add `LaravelZeroOAuthProvider` to your `config/app.php` file:

```
'providers' => [
    App\Providers\AppServiceProvider::class,
++  HSkrasek\LaravelZeroOAuth\LaravelZeroOAuthProvider::class,
],
```

Usage
-----

[](#usage)

To get started you'll want to configure your OAuth provider. This package supports all providers that are supported by [The PHP League's OAuth 2.0 Client](https://oauth2-client.thephpleague.com/), and you can find a list of providers and their configuration options [here](https://oauth2-client.thephpleague.com/providers/league/). You can do this by configuring the provider in your `.env` file:

```
OAUTH2_CLIENT_ID=
OAUTH2_CLIENT_SECRET=
OAUTH2_SCOPES=
OAUTH2_AUTHORIZE_URI=
OAUTH2_TOKEN_URI=

# Your redirect URI needs to match your applications OAuth configuration. It is recommended to use the default value, but you can change it if necessary.
# The package will attempt to correctly start a server for you using PHP's built in server.
# OAUTH2_REDIRECT_URI="http://127.0.0.1:8000"

# By default the package will use the GenericProvider, but you can change it to any provider supported by The PHP League's OAuth 2.0 Client.
# OAUTH2_PROVIDER=League\OAuth2\Client\Provider\GenericProvider::class
```

Once you've configured your provider, you can use the `oauth:login` command to start the OAuth flow:

```
php your-app-name oauth:login
```

After you've authenticated with your provider, you'll be able to access the token for requests with the `Keyring` class:

```
use HSkrasek\LaravelZeroOAuth\Auth\Keyring;

// ...

public function handle(Keyring $keyring)
{
    $token = $keyring->get('access_token');

    // Use the token to make requests to your provider.
    Http::withToken($token->accessToken)->get('https://api.example.com');
}
```

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

Laravel Zero OAuth is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

735d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9611296aa629f6c3fe02f8434ea70dc38d034d0c51985b362a66c8a293529cfc?d=identicon)[hskrasek](/maintainers/hskrasek)

---

Top Contributors

[![hskrasek](https://avatars.githubusercontent.com/u/787487?v=4)](https://github.com/hskrasek "hskrasek (38 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hskrasek-laravel-zero-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/hskrasek-laravel-zero-oauth/health.svg)](https://phpackages.com/packages/hskrasek-laravel-zero-oauth)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

25310.7M83](/packages/thenetworg-oauth2-azure)[league/oauth2-google

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

42223.4M176](/packages/league-oauth2-google)[stevenmaguire/oauth2-keycloak

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

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1152.8M12](/packages/patrickbussmann-oauth2-apple)

PHPackages © 2026

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