PHPackages                             pushauth/pushauth - 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. pushauth/pushauth

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

pushauth/pushauth
=================

A package for push authorization

1.2-stable(8y ago)02MITPHPPHP &gt;=5.5.9

Since Jul 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/pushauth/pushauth-php)[ Packagist](https://packagist.org/packages/pushauth/pushauth)[ RSS](/packages/pushauth-pushauth/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

PushAuth php code
=================

[](#pushauth-php-code)

PHP push authorization

=======

[![Latest Stable Version](https://camo.githubusercontent.com/3d169c3517582f0b3b711d75ce8c7e12d31cd186184b07d3c2b0d8b0cdf94e66/68747470733a2f2f706f7365722e707567782e6f72672f70757368617574682f70757368617574682f762f737461626c65)](https://packagist.org/packages/pushauth/pushauth)[![Total Downloads](https://camo.githubusercontent.com/57c63e8c85900f092414e34315ad7f9ae227846617b84a34b2a9e15e4834d16d/68747470733a2f2f706f7365722e707567782e6f72672f70757368617574682f70757368617574682f646f776e6c6f616473)](https://packagist.org/packages/pushauth/pushauth)[![License](https://camo.githubusercontent.com/b762eb51acdd26c8644a5242ac82542d9624613120f88d39c6186d3eb2b34784/68747470733a2f2f706f7365722e707567782e6f72672f70757368617574682f70757368617574682f6c6963656e7365)](https://packagist.org/packages/pushauth/pushauth)

### Requirements

[](#requirements)

PHP 5.6 and later.

### Composer

[](#composer)

You can install the bindings via Composer. Run the following command:

```
composer require pushauth/pushauth-php
```

To use the bindings, use Composer's autoload:

```
require_once('vendor/autoload.php');
```

### Manual Installation

[](#manual-installation)

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.

```
require_once('/path/to/pushauth-php/pushahuth.php');
```

### Dependencies

[](#dependencies)

The bindings require the following extension in order to work properly:

- curl, although you can use your own non-cURL client if you prefer
- json
- mbstring (Multibyte String)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

### Getting Started

[](#getting-started)

Simple usage looks like:

```
use PushAuth\PushAuth;

//Setting your Public & Private keys
$authRequest = new PushAuth('publicKey', 'privateKey');
```

### Sending Push Request

[](#sending-push-request)

And waiting responce from client until 30 sec:

```
$request = $authRequest->to('client@yourfirm.com')
                       ->mode('push')
                       ->response(false)
                       ->send();

if ($authRequest->isAccept()) {
                                //Make logIn action...
                            } else {
                                //Make Access Denied action...
                            }
```

Or custom wait 10 seconds response with self check:

```
$request = $authRequest->to('client@yourfirm.com')
                       ->mode('push')
                       ->response(true)
                       ->send();

$sec = 1;
while ($sec isAccept()) { //Make LogIn action }
$sec++;
sleep(1);
}

if ($authRequest->isAccept() == false) { //Make Access Denied action }
if ($authRequest->isAccept() == Null) { //No answer from client }
```

### Sending Push Code

[](#sending-push-code)

Special security code to client device:

```
$request = $authRequest->to('client@yourfirm.com')
                       ->mode('code')
                       ->code('123-456')
                       ->send();
```

### Sending Routing Push Request

[](#sending-routing-push-request)

To all clients together and wait response:

```
$request = $authRequest->to([
                                ['1'=>'client.one@yourfirm.com'],
                                ['1'=>'client.two@yourfirm.com'],
                                ['1'=>'client.three@yourfirm.com']
                                ])
                                ->response(false)
                                ->send();
```

All clients recieve push and request will be true only if all clients answering true.

To all clients by order:

```
$request = $authRequest->to([
                                ['1'=>'client.one@yourfirm.com'],
                                ['2'=>'client.two@yourfirm.com'],
                                ['3'=>'client.three@yourfirm.com']
                                ])
                       ->send();

if ($authRequest->isAccept()) { //Make LogIn action }
if ($authRequest->isAccept() == false) { //Make Access Denied action }
if ($authRequest->isAccept() == Null) { //No answer from client }
```

The first client receive push and the next client will receive push only if previous answer true. All request will be true, only if all clients answered true.

### Retrieve request status

[](#retrieve-request-status)

At any time you can view request status:

```
$request = $authRequest->to('client@yourfirm.com')
                       ->mode('push')
                       ->send();

//show request hash
print_r($request);
// will return Request Hash ex. 1232dwfef31x4xfcf34c2x4

//Show push request information
print_r($authRequest->requestStatus($request));
/*
will return array:
['answer'=>true,
'response_dt'=>'Time....',
'response_code'=>200,
'response_message'=>'Success answer received']
*/
```

### Show QR-code

[](#show-qr-code)

Generate QR-code for client reading and auth:

```
$qr_url = $authRequest->qrconfig([
            'margin'=>'5',
            'size'=>'256',
            'color'=>'121,0,121'
        ])->qr();

if ($authRequest->isAccept()) { //Make LogIn action }
if ($authRequest->isAccept() == false) { //Make Access Denied action }
if ($authRequest->isAccept() == Null) { //No answer from client }
```

### Documentation

[](#documentation)

Please see:

### Support

[](#support)

Please see:

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

3219d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c8fbbaa965b6beaec849c4635624055da9e4293011d6287d80f9032a321b579?d=identicon)[pushauth](/maintainers/pushauth)

---

Tags

authorizationpushauthorizationpushauthorization

### Embed Badge

![Health badge](/badges/pushauth-pushauth/health.svg)

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

###  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)[league/oauth2-client

OAuth 2.0 Client Library

3.8k118.6M1.2k](/packages/league-oauth2-client)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[league/oauth2-facebook

Facebook OAuth 2.0 Client Provider for The PHP League OAuth2-Client

32013.0M66](/packages/league-oauth2-facebook)

PHPackages © 2026

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