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)521.9k↓16.7%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 1mo ago

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 80% 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

3807d 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

[egroupware/openid

EGroupware OpenID Connect / OAuth2 server

1226.8k2](/packages/egroupware-openid)[xeroapi/xero-php-oauth2-app

Xero OAuth 2.0 app for PHP

217.5k](/packages/xeroapi-xero-php-oauth2-app)[surfoo/geocaching-php-sdk

Geocaching PHP SDK

143.4k1](/packages/surfoo-geocaching-php-sdk)

PHPackages © 2026

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