# authenticator **Repository Path**: wolf-code/authenticator ## Basic Information - **Project Name**: authenticator - **Description**: PHP 常用身份验证器 - **Primary Language**: Unknown - **License**: BSD-2-Clause - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-18 - **Last Updated**: 2024-11-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PHP 常用身份验证器 ```shell composer require wolfcode/authenticator ``` > To enable two-factor authentication, you'll need an app that supports TOTP such as > > [2FAS](https://2fas.com/), [Google Authenticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2), or [KeePassXC](https://keepassxc.org/). ## Google Authenticator ```php createSecret(32); // xxx You can customize the name displayed in the APP // xxx 可以自定义在APP中显示的名称 $dataUri = $ga->getQRCode('xxx',$secret); return $dataUri; // ""; } // $code: Random code on the app public function checkCode($secret,$code) { $ga = new \Wolfcode\Authenticator\google\PHPGangstaGoogleAuthenticator(); $check = $ga->verifyCode($secret,$code); var_dump($check); } ``` ## Microsoft Authenticator ```php public function test() { // Not yet supported } ```