PHPackages                             smate/duo\_php - 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. smate/duo\_php

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

smate/duo\_php
==============

A PHP implementation of the Duo Web SDK. With PHP 5.5 support

v1.0(9y ago)04.5kJavaScriptPHP &gt;=5.5

Since Apr 10Pushed 9y agoCompare

[ Source](https://github.com/smate/duo_php)[ Packagist](https://packagist.org/packages/smate/duo_php)[ Docs](https://duo.com/)[ RSS](/packages/smate-duo-php/feed)WikiDiscussions master Synced 2mo ago

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

Overview
========

[](#overview)

**duo\_php** - Duo two-factor authentication for PHP web applications:

This package allows a web developer to quickly add Duo's interactive, self-service, two-factor authentication to any web login form - without setting up secondary user accounts, directory synchronization, servers, or hardware.

Files located in the `js` directory should be hosted by your webserver for inclusion in web pages.

Deprecation
===========

[](#deprecation)

The `duo_web.php` file has been deprecated in favor of a `PSR-4` () style package.

To update your code please make the following changes:

- Install globally via composer as seen below
- Change instances of `Duo::signRequest` to `Duo\Web::signRequest`
- Change instances of `Duo::verifyResponse` to `Duo\Web::verifyResponse`

Installing
==========

[](#installing)

Development:

```
$ git clone https://github.com/duosecurity/duo_php.git
$ cd duo_php
$ composer install

```

System:

```
$ composer global require duosecurity/duo_php:dev-master

```

Or add the following to your project:

```
{
    "require": {
        "duosecurity/duo_php": "dev-master"
    }
}

```

Using
=====

[](#using)

```
$ php -a -d auto_prepend_file=vendor/autoload.php
Interactive mode enabled

php > var_dump(Duo\Web::signRequest($ikey, $skey, $akey, $username));
string(202) "TX|...TX_SIGNATURE...==|...TX_HASH...:APP|...APP_SIGNATURE...==|...APP_HASH..."

```

Demo
====

[](#demo)

First add an IKEY, SKEY, and HOST to `demos/simple/index.php`, then run the following:

```
$ php -S localhost:8080 -t demos/simple/

```

Test
====

[](#test)

```
$ ./vendor/bin/phpunit -c phpunit.xml
PHPUnit 5.3.2 by Sebastian Bergmann and contributors.

.............                                                     13 / 13 (100%)

Time: 62 ms, Memory: 6.00Mb

OK (13 tests, 13 assertions)

```

Lint
====

[](#lint)

```
$ ./vendor/bin/phpcs --standard=PSR2 -n src/* tests/*

```

Support
=======

[](#support)

Report any bugs, feature requests, etc. to us directly:

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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

3321d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eff9536be69003ae5fe2f1186cb7816101bf52d27ba18609233b27c910121629?d=identicon)[smate](/maintainers/smate)

---

Top Contributors

[![ben-duo](https://avatars.githubusercontent.com/u/2679101?v=4)](https://github.com/ben-duo "ben-duo (6 commits)")[![davidwilemski](https://avatars.githubusercontent.com/u/403152?v=4)](https://github.com/davidwilemski "davidwilemski (5 commits)")[![ojaber](https://avatars.githubusercontent.com/u/468248?v=4)](https://github.com/ojaber "ojaber (4 commits)")[![smate](https://avatars.githubusercontent.com/u/686410?v=4)](https://github.com/smate "smate (4 commits)")[![mschwager](https://avatars.githubusercontent.com/u/1724818?v=4)](https://github.com/mschwager "mschwager (2 commits)")[![sedward5](https://avatars.githubusercontent.com/u/5823049?v=4)](https://github.com/sedward5 "sedward5 (2 commits)")[![MarkSchmidty](https://avatars.githubusercontent.com/u/5949853?v=4)](https://github.com/MarkSchmidty "MarkSchmidty (1 commits)")[![BradleyHiggins](https://avatars.githubusercontent.com/u/6495554?v=4)](https://github.com/BradleyHiggins "BradleyHiggins (1 commits)")[![elliotmoore](https://avatars.githubusercontent.com/u/1574673?v=4)](https://github.com/elliotmoore "elliotmoore (1 commits)")[![alichator](https://avatars.githubusercontent.com/u/4885126?v=4)](https://github.com/alichator "alichator (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/smate-duo-php/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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