PHPackages                             hubeiwei/yii2-hawk-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. hubeiwei/yii2-hawk-auth

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

hubeiwei/yii2-hawk-auth
=======================

Hawk authorization for yii2

1.0.x-dev(7y ago)01MITPHP

Since Mar 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hubeiwei/yii2-hawk-auth)[ Packagist](https://packagist.org/packages/hubeiwei/yii2-hawk-auth)[ Docs](https://github.com/hubeiwei/yii2-hawk-auth)[ RSS](/packages/hubeiwei-yii2-hawk-auth/feed)WikiDiscussions 1.0 Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

yii2-hawk-auth
==============

[](#yii2-hawk-auth)

Hawk authorization for yii2, use package: [shawm11/hawk-auth-php](https://github.com/shawm11/hawk-auth-php)

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

[](#installation)

run:

```
composer require hubeiwei/yii2-hawk-auth 1.0.x-dev

```

or add:

```
"hubeiwei/yii2-hawk-auth": "1.0.x-dev"

```

to the require section of your composer.json file.

Agreement:
----------

[](#agreement)

id: AppKey

key: AppSecret

algorithm: sha256

Usage
-----

[](#usage)

### Server

[](#server)

User:

Add AppKey and AppSecret column into your user table

```
use hubeiwei\yii2Hawk\Auth as HawkAuth;

public static function findIdentityByAccessToken($token, $type = null)
{
    // ...

    if ($type == HawkAuth::class) {
        return self::find()->where(['app_key' => $token])->one();
    }

    // ...
}
```

Controller behaviors:

```
use hubeiwei\yii2Hawk\Auth as HawkAuth;

public function behaviors()
{
    $behaviors = parent::behaviors();
    $behaviors['authenticator'] = [
        'class' => HawkAuth::class,
        // 'header' => 'Authorization',
        // 'algorithm' => 'sha256',
        // 'keyAttribute' => 'app_secret',
    ];
    return $behaviors;
}
```

### Client

[](#client)

- [js](https://github.com/hueniverse/hawk#usage-example)
- [php](https://github.com/shawm11/hawk-auth-php#client)
- [postman](https://learning.getpostman.com/docs/postman/sending_api_requests/authorization/#hawk-authentication)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

2619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/621e9712a2d6e204da46c1a31d9025f3a804d225ee054701cffdb408e425000a?d=identicon)[hubeiwei](/maintainers/hubeiwei)

---

Top Contributors

[![hubeiwei](https://avatars.githubusercontent.com/u/17850096?v=4)](https://github.com/hubeiwei "hubeiwei (8 commits)")

---

Tags

apiauthsignauthorizationyii2hawk

### Embed Badge

![Health badge](/badges/hubeiwei-yii2-hawk-auth/health.svg)

```
[![Health](https://phpackages.com/badges/hubeiwei-yii2-hawk-auth/health.svg)](https://phpackages.com/packages/hubeiwei-yii2-hawk-auth)
```

###  Alternatives

[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)[chervand/yii2-oauth2-server

OAuth 2.0 server for Yii 2.0 with MAC tokens support.

1524.2k1](/packages/chervand-yii2-oauth2-server)[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)
