PHPackages                             il-k-honda-akamai-open/edgegrid-client - 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. il-k-honda-akamai-open/edgegrid-client

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

il-k-honda-akamai-open/edgegrid-client
======================================

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

1.0.0(8y ago)07511Apache-2.0PHPPHP &gt;=5.5

Since Jul 14Pushed 4y agoCompare

[ Source](https://github.com/il-k-honda/AkamaiOPEN-edgegrid-php-client)[ Packagist](https://packagist.org/packages/il-k-honda-akamai-open/edgegrid-client)[ Docs](https://github.com/akamai-open/AkamaiOPEN-edgegrid-php)[ RSS](/packages/il-k-honda-akamai-open-edgegrid-client/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (10)Versions (30)Used By (0)

akamai-open/edgegrid-client
===========================

[](#akamai-openedgegrid-client)

[![License](https://camo.githubusercontent.com/cf6fdc810dfb1c18c4180202ac9c19c24dd9e51fec1d1d2b956610b1bc399cb7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b616d61692f416b616d61694f50454e2d65646765677269642d7068702d636c69656e742e706e67)](https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/bc01fa3906a148fa624b72e95b9e5746a80682cd1c36d9dfaddb2c4e47b3075b/68747470733a2f2f7472617669732d63692e6f72672f616b616d61692f416b616d61694f50454e2d65646765677269642d7068702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/akamai/AkamaiOPEN-edgegrid-php-client)[![Code Coverage](https://camo.githubusercontent.com/af768fb9cf6eede3e53f2dac6dc08219273336defbe58023efeb02da1f7a4353/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616b616d61692f416b616d61694f50454e2d65646765677269642d7068702d636c69656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/akamai/AkamaiOPEN-edgegrid-php-client/?branch=master)[![API Docs](https://camo.githubusercontent.com/837ced421f5064d6f2715e451f640a1472ff1f14136bd118712dcd19f2d689d6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6170692d646f63732d626c75652e737667)](http://akamai.github.io/AkamaiOPEN-edgegrid-php-client/)

[Akamai {OPEN} EdgeGrid Authentication](https://developer.akamai.com/introduction/Client_Auth.html) Client for PHP

> **Note:** in version 0.6.0 the `\Akamai\Open\EdgeGrid\Authentication` library itself has been moved to a seperate [akamai-open/edgegrid-auth](https://packagist.org/packages/akamai-open/edgegrid-auth) package.

This library implements the Akamai {OPEN} EdgeGrid Authentication scheme on top of [Guzzle](https://github.com/guzzle/guzzle), as both a drop-in replacement client, and middleware.

For more information visit the [Akamai {OPEN} Developer Community](https://developer.akamai.com).

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

[](#installation)

This library requires PHP 5.5+, or HHVM 3.5+ to be used with the built-in Guzzle HTTP client.

To install, use [`composer`](http://getcomposer.org):

```
$ composer require akamai-open/edgegrid-client
```

### Alternative (single file) Install

[](#alternative-single-file-install)

Alternatively, download the PHAR file from the [releases](https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/releases) page.

To use it, you just include it inside your code:

```
include 'akamai-open-edgegrid-client.phar';

// Library is ready to use
```

Client Usage
------------

[](#client-usage)

The `Akamai\Open\EdgeGrid\Client` extends `\GuzzleHttp\Client` and transparently enables you to sign API requests, without interfering with other usage - this makes it a drop-in replacement, with the exception that you *must* call `\Akamai\Open\EdgeGrid\Client->setAuth()` (or provide an instance of `\Akamai\Open\EdgeGrid\Authentication` to the constructor) prior to making a request to an API.

```
$client = new Akamai\Open\EdgeGrid\Client([
	'base_uri' => 'https://akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net'
]);

$client->setAuth($client_token, $client_secret, $access_token);

// use $client just as you would \Guzzle\Http\Client
$response = $client->get('/billing-usage/v1/products');
```

### Using a Credentials File

[](#using-a-credentials-file)

We recommend using a `.edgerc` credentials file. Credentials can be generated using information on the developer site at: [https://developer.akamai.com/introduction/Prov\_Creds.html](https://developer.akamai.com/introduction/Prov_Creds.html)

Your `.edgerc` should look something like this:

```
[default]
client_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
host = xxxxx.luna.akamaiapis.net/
access_token = xxxxx
client_token = xxxxx

```

To utilize this use the factory method `\Akamai\Open\EdgeGrid\Client::createFromEdgeRcFile()`.

To create a client using the `default` credentials, in an .edgerc file that exists inside the HOME directory of the web server user, or in the current working directory:

```
$client = \Akamai\Open\EdgeGrid\Client::createFromEdgeRcFile();

// use $client just as you would \Guzzle\Http\Client
$response = $client->get('/billing-usage/v1/products');
```

Or, specify a credentials section and/or `.edgerc` location:

```
$client = \Akamai\Open\EdgeGrid\Client::createFromEdgeRcFile('example', '../config/.edgerc');

// use $client just as you would \Guzzle\Http\Client
$response = $client->get('/billing-usage/v1/products');
```

Command Line Interface
----------------------

[](#command-line-interface)

To aid in testing, exploration, and debugging, this library features a CLI that mimics [httpie](http://httpie.org) and provides a limited facsimile of it's capabilities as documented here.

If you install via composer, the CLI tool is available as `vendor/bin/http`, or you can simply execute the PHAR file.

```
# Composer installed
$ ./vendor/bin/http --help

# For Windows
> php ./vendor/bin/http --help

# PHAR download
php akamai-open-edgegrid-client.phar --help
```

### Arguments

[](#arguments)

Arguments are similar to `httpie`:

- `--auth-type={edgegrid,basic,digest}` — Set the authentication type (default: none)
- `--auth user:` or `--a user:` — Set the `.edgerc` section to use. Unlike `httpie-edgegrid` the `:` is optional

You can also specify an HTTP method (`HEAD|GET|POST|PUT|DELETE` - case-insensitive).

Finally, you can easily specify headers and JSON body fields, using the following syntaxes:

- `Header-Name:value` — Headers and values are `:` separated
- `jsonKey=value` — Sends `{"jsonKey": "value"}` in the `POST` or `PUT` body. This will also automatically set the `Content-Type` and `Accept` headers to `application/json`.
- `jsonKey:=[1,2,3]` — Allows you to specify raw JSON data, sending `{"jsonKey": [1, 2, 3]}` in the body.

### Limitations

[](#limitations)

- You cannot send `multipart/mime` (file upload) data
- Client certs are not supported
- Server certs cannot be verified
- Output cannot be customized, all HTTP and body data (request and response) is shown
- Responses are not syntax highlighted (although JSON is formatted)

Guzzle Middleware
-----------------

[](#guzzle-middleware)

This package provides three different middleware handlers:

- `\Akamai\Open\EdgeGrid\Handler\Authentication` - provides transparent API request signing
- `\Akamai\Open\EdgeGrid\Handler\Verbose` - easily output (or log) responses
- `\Akamai\Open\EdgeGrid\Handler\Debug` - easily output (or log) errors

All three can be added transparently when using the `Client`, or added to a standard `\GuzzleHttp\Client`, or by adding them as a handler.

### Transparent Usage

[](#transparent-usage)

To enable `Authentication` call `Client->setAuthentication()`, or pass in an instance of `\Akamai\EdgeGrid\Authentication`to `Client->__construct()`.

To enable `Verbose` call `Client->setInstanceVerbose()` or `Client::setVerbose()` passing in on of `true|resource|[resource output, resource error]. Defaults to `\[STDOUT, STDERR\]`.

To enable `Debug` call `Client->setInstanceDebug()`, `Client::setDebug()`, or set the `debug` config option with `true|resource`. Defaults to `STDERR`.

### Middleware

[](#middleware)

#### Authentication Handler

[](#authentication-handler)

```
// Create the Authentication Handler
$auth = \Akamai\Open\EdgeGrid\Handler\Authentication::createFromEdgeRcFile();
// or:
$auth = new \Akamai\Open\EdgeGrid\Handler\Authentication;
$auth->setAuth($client_token, $client_secret, $access_token);

// Create the handler stack
$handlerStack = \GuzzleHttp\HandlerStack::create();

// Add the Auth handler to the stack
$handlerStack->push($auth);

// Add the handler to a regular \GuzzleHttp\Client
$guzzle = new \GuzzleHttp\Client([
    "handler" => $handlerStack
]);
```

#### Verbose Handler

[](#verbose-handler)

```
// Create the handler stack
$handlerStack = HandlerStack::create();

// Add the Auth handler to the stack
$handlerStack->push(new \Akamai\Open\EdgeGrid\Handler\Verbose());

// Add the handler to a regular \GuzzleHttp\Client
$guzzle = new \GuzzleHttp\Client([
    "handler" => $handlerStack
]);
```

### Debug Handler

[](#debug-handler)

```
// Create the handler stack
$handlerStack = HandlerStack::create();

// Add the Auth handler to the stack
$handlerStack->push(new \Akamai\Open\EdgeGrid\Handler\Debug());

// Add the handler to a regular \GuzzleHttp\Client
$guzzle = new \GuzzleHttp\Client([
    "handler" => $handlerStack
]);
```

### Using PHP 5.3 (not recommended)

[](#using-php-53-not-recommended)

> PHP 5.3 has been EOL since August 14th, 2014, and has **known** security vulnerabilities, therefore we do not recommend using it. However, we understand that many actively supported LTS distributions are still shipping with PHP 5.3, and therefore we are providing the following information.

The signer itself is PHP 5.3 compatible and has been moved to the [akamai-open/edgegrid-auth](https://packagist.org/packages/akamai-open/edgegrid-auth) package.

Author
------

[](#author)

Davey Shafik

License
-------

[](#license)

Copyright 2016 Akamai Technologies, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at .

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 92.2% 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 ~43 days

Recently: every ~64 days

Total

19

Last Release

3229d ago

Major Versions

0.6.4 → 1.0.0beta12017-01-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32387466?v=4)[il\_k-honda](/maintainers/il-k-honda)[@il-k-honda](https://github.com/il-k-honda)

---

Top Contributors

[![dshafik](https://avatars.githubusercontent.com/u/58074?v=4)](https://github.com/dshafik "dshafik (154 commits)")[![synedra](https://avatars.githubusercontent.com/u/77410784?v=4)](https://github.com/synedra "synedra (5 commits)")[![il-k-honda](https://avatars.githubusercontent.com/u/32387466?v=4)](https://github.com/il-k-honda "il-k-honda (4 commits)")[![volment](https://avatars.githubusercontent.com/u/1253446?v=4)](https://github.com/volment "volment (2 commits)")[![hokamoto](https://avatars.githubusercontent.com/u/1726523?v=4)](https://github.com/hokamoto "hokamoto (1 commits)")[![siwinski](https://avatars.githubusercontent.com/u/1034024?v=4)](https://github.com/siwinski "siwinski (1 commits)")

---

Tags

clientAuthenticationopenakamaiedgegrid

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/il-k-honda-akamai-open-edgegrid-client/health.svg)

```
[![Health](https://phpackages.com/badges/il-k-honda-akamai-open-edgegrid-client/health.svg)](https://phpackages.com/packages/il-k-honda-akamai-open-edgegrid-client)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

492.6M6](/packages/akamai-open-edgegrid-client)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[google/auth

Google Auth Library for PHP

1.4k294.2M220](/packages/google-auth)[craftcms/cms

Craft CMS

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

PHPackages © 2026

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