PHPackages                             greghanton/simplifi-hq-oauth-api - 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. greghanton/simplifi-hq-oauth-api

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

greghanton/simplifi-hq-oauth-api
================================

OAuth2 client and request dispatcher for the Joy Pilot API tier

1.1.2(4d ago)01.2kproprietaryPHPPHP ^8.1CI failing

Since May 4Pushed 4d ago2 watchersCompare

[ Source](https://github.com/greghanton/simplifi-hq-oauth-api)[ Packagist](https://packagist.org/packages/greghanton/simplifi-hq-oauth-api)[ RSS](/packages/greghanton-simplifi-hq-oauth-api/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (18)Versions (8)Used By (0)

simplifi-hq-oauth-api
=====================

[](#simplifi-hq-oauth-api)

OAuth2 client and request dispatcher for the Joy Pilot API tier.

Install
-------

[](#install)

```
composer require greghanton/simplifi-hq-oauth-api
```

Configuration
-------------

[](#configuration)

This package loads defaults from `config.php` and then reads values from environment variables using `simplifiHqOauthApiLibEnv()`.

### Environment variables

[](#environment-variables)

VariableRequiredDefaultNotes`SIMPLIFI_API_GRANT_TYPE`No`client_credentials`The only grant this package itself can mint. The `password` grant is **disabled server-side** (not just deprecated) — see [Per-consumer grant matrix](#per-consumer-grant-matrix).`SIMPLIFI_API_CLIENT_ID`Yes-OAuth client id.`SIMPLIFI_API_CLIENT_SECRET`Yes-OAuth client secret.`SIMPLIFI_API_USERNAME`No (legacy)-Dead unless a future grant reintroduces it; the `password` grant that read this is disabled server-side.`SIMPLIFI_API_PASSWORD`No (legacy)-Dead alongside `SIMPLIFI_API_USERNAME`, same reason.`SIMPLIFI_API_SCOPE`No`*`OAuth scope, forwarded as-is to `/oauth/token`.`SIMPLIFI_API_ALLOW_SERVICE_MINT`No`true`Set `false` on any **per-session/user-context** config (see [User-scoped tokens](#user-scoped-tokens-the-package-never-mints-them)). Leave `true` (default) on the global/anonymous config.`SIMPLIFI_API_URL_BASE`Yes-API base URL, e.g. `https://api.example.com/`.`SIMPLIFI_API_ACCESS_TOKEN_STORE_AS`No`temp_file``custom` is recommended for production, `temp_file` is fine for local/dev.`SIMPLIFI_API_ACCESS_TOKEN_TEMP_FILE_FILENAME`NoDerived from project path/versionOnly used when `store_as=temp_file`.`SIMPLIFI_API_ACCESS_TOKEN_CUSTOM_KEY`For `custom` store`simplifi-hq-oauth-api-access-token`Key passed to custom callables.`SIMPLIFI_API_ACCESS_TOKEN_GET`For `custom` store-JSON-encoded callable. Signature: `get($customKey): ?string`.`SIMPLIFI_API_ACCESS_TOKEN_SET`For `custom` store-JSON-encoded callable. Signature: `set($customKey, $tokenJson): mixed`.`SIMPLIFI_API_ACCESS_TOKEN_DEL`For `custom` store-JSON-encoded callable. Signature: `del($customKey): mixed`.`SIMPLIFI_API_ACCESS_TOKEN_LOCK`Optional-JSON-encoded callable. Signature: `lock($customKey, $ttlSeconds): bool`.`SIMPLIFI_API_ACCESS_TOKEN_UNLOCK`Optional-JSON-encoded callable. Signature: `unlock($customKey): mixed`.`SIMPLIFI_API_ERROR_LOG_FUNCTION`No`"error_log"`JSON-encoded callable for internal error logging.`SIMPLIFI_API_DEFAULT_HEADERS`No`[]`JSON object of headers merged into each request.`SIMPLIFI_API_SSL_VERIFY`No`true`TLS certificate verification for HTTP requests.`SIMPLIFI_API_ADD_TRACE_DEBUG_HEADER`No`false`Adds `trace-debug-header` from caller backtrace.Basic usage
-----------

[](#basic-usage)

### Synchronous request

[](#synchronous-request)

```
