PHPackages                             mpie/lighthouse-oauth2 - 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. [API Development](/categories/api)
4. /
5. mpie/lighthouse-oauth2

ActiveLibrary[API Development](/categories/api)

mpie/lighthouse-oauth2
======================

An OAuth2 implementation for Lighthouse

v0.4.3(4y ago)020MITPHPPHP ^7.3|^8.0

Since Dec 5Pushed 4y ago2 watchersCompare

[ Source](https://github.com/mpie/lighthouse-oauth2)[ Packagist](https://packagist.org/packages/mpie/lighthouse-oauth2)[ Docs](https://mpie.dev)[ RSS](/packages/mpie-lighthouse-oauth2/feed)WikiDiscussions master Synced 3w ago

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

lighthouse-oauth2
=================

[](#lighthouse-oauth2)

An OAuth2 implementation for Laravel Lighthouse through Passport

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

[](#installation)

To install run

```
composer require mpie/lighthouse-oauth2

```

ServiceProvider will be attached automatically.

Add the following env vars to your .env from the oauth\_clients and the password grant client.

```
LIGHTHOUSE_OAUTH2_CLIENT_ID=
LIGHTHOUSE_OAUTH2_CLIENT_SECRET=

```

You are done with the installation!

Tweaking configurations
-----------------------

[](#tweaking-configurations)

In case you need to point to a different url such as a subdomain that is running in the same app add (without the last slash):

```
LIGHTHOUSE_OAUTH2_DOMAIN="https://sub.domain.com"

```

Changing the grant type to 'password' instead of the default 'authorization\_code':

```
LIGHTHOUSE_OAUTH2_GRANT_TYPE="password"

```

Changing the default scope of '\*':

```
LIGHTHOUSE_OAUTH2_SCOPE="email,something,another"

```

Unique feature. You can change the default guard 'api' for the user lookup instead of being vendor locked:

```
LIGHTHOUSE_OAUTH2_GUARD="super-private-guard"

```

The user model is returned when login mutation is called. This can be disabled with:

```
LIGHTHOUSE_OAUTH2_FETCH_USER=false # Make sure you uncomment 'user: User' model in the graphql file

```

User column matching (will be applied when 'fetch\_user' is true). Defaults to 'email':

```
LIGHTHOUSE_OAUTH2_USER_COLUMN=id

```

Customizing the schema
----------------------

[](#customizing-the-schema)

```
php artisan vendor:publish --provider="Mpie\LighthouseOAuth\LighthouseOAuthServiceProvider"

```

This will publish the schema. There are no migration files.

Then update the `lighthouse-oauth2.php` configuration file to point the schema file to load the exported file instead of the one provided by the package.

```
/*
|--------------------------------------------------------------------------
| GraphQL schema
|--------------------------------------------------------------------------
|
| File path of the GraphQL schema to be used, defaults to null so it uses
| the default location
|
*/
'schema' => base_path('graphql/oauth2.graphql'),
```

From there you can customize the schema to fit your needs.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Total

9

Last Release

1630d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/99145?v=4)[Ai-yakaan](/maintainers/mpie)[@mpie](https://github.com/mpie)

---

Top Contributors

[![mpie](https://avatars.githubusercontent.com/u/99145?v=4)](https://github.com/mpie "mpie (20 commits)")

---

Tags

laravelgraphqloauth2passportlaravel-graphqllighthouse

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpie-lighthouse-oauth2/health.svg)

```
[![Health](https://phpackages.com/badges/mpie-lighthouse-oauth2/health.svg)](https://phpackages.com/packages/mpie-lighthouse-oauth2)
```

###  Alternatives

[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k11.8M116](/packages/nuwave-lighthouse)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.5k91.9M588](/packages/laravel-passport)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M129](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M129](/packages/roots-acorn)[essa/api-tool-kit

set of tools to build an api with laravel

53386.5k](/packages/essa-api-tool-kit)

PHPackages © 2026

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