PHPackages                             datto/json-rpc-auth - 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. datto/json-rpc-auth

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

datto/json-rpc-auth
===================

Auth extension for JSON-RPC library

4.0.0(10y ago)522.5k↑80%2LGPL-3.0PHP

Since Dec 15Pushed 10y ago3 watchersCompare

[ Source](https://github.com/datto/php-json-rpc-auth)[ Packagist](https://packagist.org/packages/datto/json-rpc-auth)[ Docs](http://www.datto.com)[ RSS](/packages/datto-json-rpc-auth/feed)WikiDiscussions master Synced yesterday

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

JSON-RPC Auth Extension
=======================

[](#json-rpc-auth-extension)

This is an authentication and authorization extension for the [php-json-rpc](https://github.com/datto/php-json-rpc) library. It provides the ability to authorize JSON-RPC requests before they reach the endpoint.

Examples
--------

[](#examples)

First write an authentication `Handler`:

```
namespace Datto\JsonRpc\Auth;

use Datto\JsonRpc;

class BasicAuthHandler implements Handler
{
    public function canHandle($method, $arguments)
    {
        return isset($_SERVER['PHP_AUTH_USER']);
    }

    public function authenticate($method, $arguments)
    {
        // Don't do this in production. Using '===' is vulnerable to timing attacks!
        return $_SERVER['PHP_AUTH_USER'] === 'phil' && $_SERVER['PHP_AUTH_PW'] === 'superpass!';
    }
}
```

Once you have that, just use it like this. This example uses the `Simple\Evaluator` (see [php-json-rpc-simple](https://github.com/datto/php-json-rpc-simple)) as underlying mapping mechanism:

```
$authenticator = new Authenticator(array(
    new BasicAuthHandler(),
    // ...
));

$server = new Server(new Auth\Evaluator(new Simple\Evaluator(), $authenticator));
echo $server->reply('...');
```

Requirements
------------

[](#requirements)

- PHP &gt;= 5.3

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

[](#installation)

```
"require": {
  "datto/json-rpc-auth": "~4.0"
}
```

License
-------

[](#license)

This package is released under an open-source license: [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html).

Author
------

[](#author)

Written by Chad Kosie and [Philipp C. Heckel](https://github.com/binwiederhier).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3852d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb044681aa172ced7a03b093bda1f1f1031831133281d3d1e036807d28260c31?d=identicon)[datto-packagist-maintainer](/maintainers/datto-packagist-maintainer)

![](https://www.gravatar.com/avatar/b647bf89da1bd2cf46183f99d135c02a69bfdef6d446293015e438718ba553c2?d=identicon)[binwiederhier](/maintainers/binwiederhier)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/datto-json-rpc-auth/health.svg)

```
[![Health](https://phpackages.com/badges/datto-json-rpc-auth/health.svg)](https://phpackages.com/packages/datto-json-rpc-auth)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[egroupware/openid

EGroupware OpenID Connect / OAuth2 server

1228.1k4](/packages/egroupware-openid)

PHPackages © 2026

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