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

Abandoned → [duosecurity/duo\_universal\_php](/?search=duosecurity%2Fduo_universal_php)ArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

duosecurity/duo\_php
====================

A PHP implementation of the Duo Web SDK.

1.0.1(6y ago)83351.3k↑10.5%361JavaScriptPHP &gt;=5.6

Since May 24Pushed 3y ago54 watchersCompare

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

READMEChangelogDependencies (3)Versions (3)Used By (1)

Deprecation Notice
==================

[](#deprecation-notice)

This repository is deprecated by Duo Security. The repository will remain public and visible, and integrations built using this repository’s code will continue to work. You can also continue to fork, clone, or pull from this repository.

However, Duo will not provide any further releases or enhancements.

Duo recommends migrating your application to the Duo Universal Prompt. Refer to [our documentation](https://duo.com/docs/universal-prompt-update-guide) for more information on how to update.

For frequently asked questions about the impact of this deprecation, please see the [Repository Deprecation FAQ](https://duosecurity.github.io/faq.html)

---

Overview
========

[](#overview)

[![Build Status](https://github.com/duosecurity/duo_php/workflows/PHP%20CI/badge.svg?branch=master)](https://github.com/duosecurity/duo_php/actions)[![Issues](https://camo.githubusercontent.com/dfa245f338b3b219630e5add14a7a75cc342aa8ae35d0458432927ed1edf71bf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f64756f73656375726974792f64756f5f706870)](https://github.com/duosecurity/duo_php/issues)[![Forks](https://camo.githubusercontent.com/1c4d4e45457a46bae66c456e53b7a020ed4b0c50e74c0b878b39edb4a3fc3b65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f64756f73656375726974792f64756f5f706870)](https://github.com/duosecurity/duo_php/network/members)[![Stars](https://camo.githubusercontent.com/adf8eb6f13be30aaaa4770c7cef95eb1861fb5525021d428c88f345d61c21211/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64756f73656375726974792f64756f5f706870)](https://github.com/duosecurity/duo_php/stargazers)[![License](https://camo.githubusercontent.com/540a936590506d6d7bb40bb43e570377e2a294b7bed3f02659c759465e431990/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d566965772532304c6963656e73652d6f72616e6765)](https://github.com/duosecurity/duo_php/blob/master/LICENSE)

**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.

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

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity59

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

Every ~959 days

Total

2

Last Release

2322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/255c187591bf809c09b067f6e574faa010153e59cba417a122aec9afcb4ed582?d=identicon)[duo\_security](/maintainers/duo_security)

---

Top Contributors

[![AaronAtDuo](https://avatars.githubusercontent.com/u/26978047?v=4)](https://github.com/AaronAtDuo "AaronAtDuo (10 commits)")[![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)")[![sedward5](https://avatars.githubusercontent.com/u/5823049?v=4)](https://github.com/sedward5 "sedward5 (2 commits)")[![mschwager](https://avatars.githubusercontent.com/u/1724818?v=4)](https://github.com/mschwager "mschwager (2 commits)")[![jeffreyparker](https://avatars.githubusercontent.com/u/593286?v=4)](https://github.com/jeffreyparker "jeffreyparker (1 commits)")[![MarkSchmidty](https://avatars.githubusercontent.com/u/5949853?v=4)](https://github.com/MarkSchmidty "MarkSchmidty (1 commits)")[![alichator](https://avatars.githubusercontent.com/u/4885126?v=4)](https://github.com/alichator "alichator (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)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[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)[illuminate/auth

The Illuminate Auth package.

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

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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