PHPackages                             rob006/yii2-simple-auth-yii-authenticator - 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. rob006/yii2-simple-auth-yii-authenticator

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

rob006/yii2-simple-auth-yii-authenticator
=========================================

Yii 2 extension that provides helper for authenticate Request from yii2-httpclient package.

1.0.1(9y ago)297MITPHP

Since Sep 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/rob006-software/yii2-simple-auth-yii-authenticator)[ Packagist](https://packagist.org/packages/rob006/yii2-simple-auth-yii-authenticator)[ RSS](/packages/rob006-yii2-simple-auth-yii-authenticator/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Helper for authenticate Request from yii2-httpclient package
============================================================

[](#helper-for-authenticate-request-from-yii2-httpclient-package)

Yii 2 extension that provides helper for authenticate `Request` from [yii2-httpclient](https://github.com/yiisoft/yii2-httpclient) package.

This is a simple helper for [yii2-simple-auth](https://github.com/rob006/yii2-simple-auth) which simplify authenticating `Request` object from official Yii 2 httpclient extension. Read [yii2-simple-auth README](https://github.com/rob006/yii2-simple-auth/blob/master/README.md#configuration)to get more details about authentication process and configuration.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require rob006/yii2-simple-auth-yii-authenticator
```

or add

```
"rob006/yii2-simple-auth-yii-authenticator": "^1.0"
```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

You can simply authenticate `Request` object from official Yii 2 [httpclient](https://github.com/yiisoft/yii2-httpclient)by using `YiiAuthenticator` helper:

```
use yii\httpclient\Client;
use rob006\simpleauth\YiiAuthenticator as Authenticator;

$client = new Client();
$request = $client->createRequest()
	->setUrl('http://api.example.com/user/list/')
	->setData(['ids' => '1,2,3,4']);
$request = Authenticator::authenticate($request);
$response = $request->send();
```

By default `Authenticator` sends authentication token in the header of the request. Alternatively you can send it in GET or POST param of request. Be careful when you using POST method because this will set request method as POST and all data set by `\yii\httpclient\Request::setData()` will be sent as POST data and will not be included in the URL.

Authentication by GET param with custom secret key:

```
use yii\httpclient\Client;
use rob006\simpleauth\YiiAuthenticator as Authenticator;

$client = new Client();
$request = $client->createRequest()
	->setUrl('http://api.example.com/user/list/')
	->setData(['ids' => '1,2,3,4']);
$request = Authenticator::authenticate($request, Authenticator::METHOD_GET, 'mycustomsecretkey');
$response = $request->send();
```

Authentication by POST param:

```
use yii\httpclient\Client;
use rob006\simpleauth\YiiAuthenticator as Authenticator;

$client = new Client();
$request = $client->createRequest()
	->setUrl('http://api.example.com/user/list/?ids=1,2,3,4');
$request = Authenticator::authenticate($request, Authenticator::METHOD_POST);
$response = $request->send();
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Every ~214 days

Total

2

Last Release

3371d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b6f0a1cac6366571b3681228cdfc493f7e018e4c966f35e75e95f918ae417ff?d=identicon)[rob006](/maintainers/rob006)

---

Top Contributors

[![rob006](https://avatars.githubusercontent.com/u/5972388?v=4)](https://github.com/rob006 "rob006 (12 commits)")

---

Tags

authenticationyii2yii2-extensionyii2-httpclientauthAuthenticationyii2extensionauthenticator

### Embed Badge

![Health badge](/badges/rob006-yii2-simple-auth-yii-authenticator/health.svg)

```
[![Health](https://phpackages.com/badges/rob006-yii2-simple-auth-yii-authenticator/health.svg)](https://phpackages.com/packages/rob006-yii2-simple-auth-yii-authenticator)
```

###  Alternatives

[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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