PHPackages                             aplr/laravel-passport-grant-anonymous - 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. aplr/laravel-passport-grant-anonymous

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

aplr/laravel-passport-grant-anonymous
=====================================

Anonymous Grant for Laravel Passport.

v0.1.4(7y ago)191MITPHPPHP &gt;=5.6.4

Since Apr 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aplr/laravel-passport-grant-anonymous)[ Packagist](https://packagist.org/packages/aplr/laravel-passport-grant-anonymous)[ RSS](/packages/aplr-laravel-passport-grant-anonymous/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (6)Used By (0)

Laravel Passport: Anonymous Grant
=================================

[](#laravel-passport-anonymous-grant)

[![Travis](https://camo.githubusercontent.com/5ce049e40c57cd76fe2627e5ad492c0a1069f2cceba7f69ac43dd639ec138f41/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f61706c722f6c61726176656c2d70617373706f72742d6772616e742d616e6f6e796d6f75732e737667)](https://packagist.org/packages/aplr/laravel-passport-grant-anonymous)[![Packagist](https://camo.githubusercontent.com/39fc1939db1d44c25efaeb4ad0f89dedb009a915cf22eac49faecd686bd683b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61706c722f6c61726176656c2d70617373706f72742d6772616e742d616e6f6e796d6f75732e737667)](https://packagist.org/packages/aplr/laravel-passport-grant-anonymous)[![license](https://camo.githubusercontent.com/8e76e3de9db602e840317c81d68d7facdb6f0a1c53d246f253551b61d17a9ffb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f61706c722f6c61726176656c2d70617373706f72742d6772616e742d616e6f6e796d6f75732e737667)](https://packagist.org/packages/aplr/laravel-passport-grant-anonymous)

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

[](#introduction)

The `laravel-passport-grant-anonymous` package allows you to use a Anonymous Grant in addition to the default Password Grant in Laravel Passport.

This allows "anonymous" users without a password to get an OAuth token using a unique identifier, like eg. a string unique to a user's device.

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

[](#installation)

Require the aplr/laravel-passport-grant-anonymous package in your composer.json and update your dependencies:

```
$ composer require aplr/laravel-passport-grant-anonymous
```

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
Aplr\LaravelPassportAnonymous\ServiceProvider::class,
```

Usage
-----

[](#usage)

You need to provide a field `auth_id` in the user table such that the associated user model can be retreived later by the grant.

### Prepare your model

[](#prepare-your-model)

To allow this, you either need to provide the field as mentioned, or implement the method `public findByAuthId(string $authId)`, which returns the user model identified by `authId`.

### Using the grant

[](#using-the-grant)

After you have prepared your models, you can use the grant as you would normally use the [password grant](https://laravel.com/docs/5.7/passport#requesting-password-grant-tokens), but with the `grant_type` set to `anonymous` and the unique identifier passed using the `auth_id` field. Requesting an access token using the anonymous grant looks like the following:

```
$http = new GuzzleHttp\Client;

$response = $http->post('http://your-app.com/oauth/token', [
    'form_params' => [
        'grant_type' => 'anonymous',
        'client_id' => 'client-id',
        'client_secret' => 'client-secret',
        'auth_id' => 'some-unique-identifier',
        'scope' => '',
    ],
]);

return json_decode((string) $response->getBody(), true);
```

Licence
-------

[](#licence)

`laravel-passport-grant-anonymous` is open-sourced software licensed under the MIT license.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

2798d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1723f152d0d0015ac9fd0ee662732f276ac4fe314c245f6dad7a710155e75bb9?d=identicon)[aplr](/maintainers/aplr)

---

Top Contributors

[![aplr](https://avatars.githubusercontent.com/u/1051396?v=4)](https://github.com/aplr "aplr (7 commits)")

---

Tags

laraveloauthpassport

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aplr-laravel-passport-grant-anonymous/health.svg)

```
[![Health](https://phpackages.com/badges/aplr-laravel-passport-grant-anonymous/health.svg)](https://phpackages.com/packages/aplr-laravel-passport-grant-anonymous)
```

###  Alternatives

[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)[danjdewhurst/laravel-passport-facebook-login

Facebook Token Request Grant for Laravel Passport

2824.4k](/packages/danjdewhurst-laravel-passport-facebook-login)[mikemclin/passport-custom-request-grant

Custom Request Grant for Laravel Passport

343.6k](/packages/mikemclin-passport-custom-request-grant)

PHPackages © 2026

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