PHPackages                             duosecurity/duo\_api\_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. [API Development](/categories/api)
4. /
5. duosecurity/duo\_api\_php

ActiveLibrary[API Development](/categories/api)

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

A PHP implementation of the Duo API.

1.2.1(4mo ago)311.3M↓39.9%28[1 PRs](https://github.com/duosecurity/duo_api_php/pulls)5PHPPHP &gt;=8.0CI failing

Since Apr 4Pushed 2mo ago31 watchersCompare

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

READMEChangelog (2)Dependencies (3)Versions (9)Used By (5)

Overview
========

[](#overview)

[![Build Status](https://github.com/duosecurity/duo_api_php/workflows/PHP%20CI/badge.svg?branch=master)](https://github.com/duosecurity/duo_api_php/actions)

**Auth** -

**Admin** -

**Accounts** -

Tested Against PHP Versions:
----------------------------

[](#tested-against-php-versions)

- 8.2
- 8.3
- 8.4
- 8.5

TLS 1.2 and 1.3 Support
-----------------------

[](#tls-12-and-13-support)

Duo\_api\_php uses PHP's cURL extension and OpenSSL for TLS operations. TLS support will depend on the versions of multiple libraries:

TLS 1.2 support requires PHP 5.5 or higher, curl 7.34.0 or higher, and OpenSSL 1.0.1 or higher.

TLS 1.3 support requires PHP 7.3 or higher, curl 7.61.0 or higher, and OpenSSL 1.1.1 or higher.

Installing
==========

[](#installing)

Development:

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

```

System:

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

```

Or add the following to your project:

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

```

Using
=====

[](#using)

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

php > $D = new DuoAPI\Auth($ikey, $skey, $host);
php > var_dump($D->preauth($username));
array(2) {
  'response' =>
  array(2) {
    'response' =>
    array(3) {
      'enroll_portal_url' =>
      string(23) "https://api-example.com"
      'result' =>
      string(6) "enroll"
      'status_msg' =>
      string(42) "Enroll an authentication device to proceed"
    }
    'stat' =>
    string(2) "OK"
  }
  'success' =>
  bool(true)
}

```

Testing
=======

[](#testing)

```
$ ./vendor/bin/phpunit -c phpunit.xml

```

Note that the tests in `tests/SSL/SSLTest.php` require `stunnel3`.

Linting
=======

[](#linting)

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

```

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity54

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~598 days

Recently: every ~554 days

Total

7

Last Release

125d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6

1.1.0PHP &gt;=8.0

### 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 (24 commits)")[![mbish](https://avatars.githubusercontent.com/u/1400336?v=4)](https://github.com/mbish "mbish (6 commits)")[![jeffreyparker](https://avatars.githubusercontent.com/u/593286?v=4)](https://github.com/jeffreyparker "jeffreyparker (5 commits)")[![mschwager](https://avatars.githubusercontent.com/u/1724818?v=4)](https://github.com/mschwager "mschwager (3 commits)")[![DenitsaTH](https://avatars.githubusercontent.com/u/155546400?v=4)](https://github.com/DenitsaTH "DenitsaTH (2 commits)")[![nstojcevich](https://avatars.githubusercontent.com/u/13511571?v=4)](https://github.com/nstojcevich "nstojcevich (1 commits)")[![xdesai](https://avatars.githubusercontent.com/u/19935687?v=4)](https://github.com/xdesai "xdesai (1 commits)")[![yizshi](https://avatars.githubusercontent.com/u/61877973?v=4)](https://github.com/yizshi "yizshi (1 commits)")[![zmilan](https://avatars.githubusercontent.com/u/302135?v=4)](https://github.com/zmilan "zmilan (1 commits)")[![ckeif-duo](https://avatars.githubusercontent.com/u/175957886?v=4)](https://github.com/ckeif-duo "ckeif-duo (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![ericnorris](https://avatars.githubusercontent.com/u/1906605?v=4)](https://github.com/ericnorris "ericnorris (1 commits)")[![maxnz](https://avatars.githubusercontent.com/u/16338288?v=4)](https://github.com/maxnz "maxnz (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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