duosecurity/duo_universal_php
Composer 安装命令:
composer require duosecurity/duo_universal_php
包简介
A PHP implementation of the Duo Universal SDK.
README 文档
README
This SDK allows a web developer to quickly add Duo's interactive, self-service, two-factor authentication to any PHP web login form.
What's included:
src- The PHP Duo SDK for interacting with the Duo Universal Promptexample- An example PHP application with Duo integratedtests- Test cases
Getting started
This library requires PHP 8.2 or later
To use SDK in your existing developing environment, install it from Packagist
composer require duosecurity/duo_universal_php
Once it's installed, see our developer documentation at https://duo.com/docs/duoweb and sample/index.php in this repo for guidance on integrating Duo 2FA into your web application.
TLS 1.2 and 1.3 Support
Duo_universal_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.
Contribute
To contribute, fork this repo and make a pull request with your changes when they are ready.
Install the SDK from source:
composer install
Run interactive mode
php -a -d auto_prepend_file=vendor/autoload.php
Interactive shell
php > $client = new Duo\DuoUniversal\Client("IntegrationKey", "SecretKey", "api-XXXXXXXX.duosecurity.com", "https://example.com");
php > $state = $client->generateState();
php > $username = "example";
string(700) "https://api-XXXXXXXX.duosecurity.com/oauth/v1/authorize?response_type=code&client_id=DIXXXXXXXXXXXXXXXXXX&scope=openid&redirect_uri=https%3A%2F%2Fexample.com&request=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzY29wZSI6Im9wZW5pZCIsInJlZGlyZWN0X3VyaSI6Imh0dHBzOlwvXC9leGFtcGxlLmNvbSIsImNsaWVudF9pZCI6IkRJWFhYWFhYWFhYWFhYWFhYWFhYIiwiaXNzIjoiRElYWFhYWFhYWFhYWFhYWFhYWFgiLCJhdWQiOiJodHRwczpcL1wvYXBpLVhYWFhYWFhYLmR1b3NlY3VyaXR5LmNvbSIsImV4cCI6MTYxMjI5OTA3Nywic3RhdGUiOiJtYjlWalFGeDNzMEswRVpidVBJMmlCVWE4N29qbWFMTUl2VksiLCJyZXNwb25zZV90eXBlIjoiY29kZSIsImR1b191bmFtZSI6ImV4YW1wbGUiLCJ1c2VfZHVvX2NvZGVfYXR0cmlidXRlIjp0cnVlfQ.8Pr02LJd0pi6rsiAf5mvzGbf51piHysHyP5PlmnMiwNIkQ0HsYED0wECilXxsIyISz--oU528Cy7Sfebj0copg"
Tests
./vendor/bin/phpunit --process-isolation tests
Lint
To run linter
./vendor/bin/phpcs --standard=.duo_linting.xml -n src/* tests
duosecurity/duo_universal_php 适用场景与选型建议
duosecurity/duo_universal_php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.73M 次下载、GitHub Stars 达 25, 最近一次更新时间为 2021 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 duosecurity/duo_universal_php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 duosecurity/duo_universal_php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.73M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 12
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-03-15