PHPackages                             amsxbg/box-jwt - 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. amsxbg/box-jwt

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

amsxbg/box-jwt
==============

103.7k8[3 issues](https://github.com/amgrobelny-box/box-jwt-php/issues)[4 PRs](https://github.com/amgrobelny-box/box-jwt-php/pulls)PHP

Since Jun 21Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/amgrobelny-box/box-jwt-php)[ Packagist](https://packagist.org/packages/amsxbg/box-jwt)[ RSS](/packages/amsxbg-box-jwt/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

Read Me
=======

[](#read-me)

Getting Started
---------------

[](#getting-started)

Before you can begin working on your PHP code, you'll need to configure your application settings with Box. To start your application configuration, follow these [instructions](https://developer.box.com/v2.0/docs/configuring-box-platform).

Make sure to select **OAuth 2.0 with JWT (Server Authentication)** for **Authentication Method**.

Also make sure to give your application the permissions to handle files and folders. For the purpose of the included examples, permission should be given to read and write files and perform actions as users.

After you've created/generated your RSA keypair, download your app configuration JSON file.

Configure Your Local Setup
--------------------------

[](#configure-your-local-setup)

Clone the project to your local computer.

Make a copy of `example.box.config.php` (in the project root directory) and save it as `box.config.php`. Fill out the missing values from your downloaded configuration JSON file.

`jwtPrivateKey` is the path to your private key you created/generated earlier. For example, if your private key, `pkey.pem`, is in your local project directory, you'll set it like this:

```
return array(
    "clientId" => "",
    "clientSecret" => "",
    "enterpriseId" => "",
    "jwtPrivateKey" => __DIR__ . "/pkey.pem",
    "jwtPrivateKeyPassword" => "",
    "jwtPublicKeyId" => "",
);
```

Install dependencies (assuming you already have [Composer](https://getcomposer.org/) installed).

```
composer install
```

Run an Example
--------------

[](#run-an-example)

Examples are stored in the `examples` folder in the project root directory. To run the example to retrieve an access token, execute the following from the project root directory:

```
php ./examples/exAuthGetAccessToken.php
```

This will return something like the following:

```
Access Token: BrTUlJQ55EhpAZFXYmJXXfZxuCvM5uq1

```

Examples dealing with files and folders will impersonate a Box user. You'll need to open the example file and fill in the email for `$userLogin`.

```
$userLogin = 'johndoe@example.com';
```

Starting Your Project
---------------------

[](#starting-your-project)

Simply include your autoloader and the `helpers/helpers.php` as in `bootstrap/autoload.php`. Once you've done that, use the examples to help you get started. A good example to get started with is `examples/exAuthGetAccessToken.php`.

Run Tests
---------

[](#run-tests)

Make a copy of `example.phpunit.xml` as `phpunit.xml` Open up `phpunit.xml` and fill out `AS_USER_EMAIL` with the Box user account login email. This is the account the tests will impersonate.

```

```

Run the tests.

```
phpunit
```

You should get an output like this:

```
PHPUnit 7.0.1 by Sebastian Bergmann and contributors.

............                                                      12 / 12 (100%)

Time: 58.06 seconds, Memory: 6.00MB

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance40

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 76.7% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1121188?v=4)[pixart](/maintainers/pixart)[@pixart](https://github.com/pixart)

---

Top Contributors

[![comanche](https://avatars.githubusercontent.com/u/1100167?v=4)](https://github.com/comanche "comanche (23 commits)")[![allenmichael](https://avatars.githubusercontent.com/u/9440998?v=4)](https://github.com/allenmichael "allenmichael (7 commits)")

### Embed Badge

![Health badge](/badges/amsxbg-box-jwt/health.svg)

```
[![Health](https://phpackages.com/badges/amsxbg-box-jwt/health.svg)](https://phpackages.com/packages/amsxbg-box-jwt)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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