定制 thecsea/twofactor-dir 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thecsea/twofactor-dir

Composer 安装命令:

composer require thecsea/twofactor-dir

包简介

The most powerful and the simplest library to add two factor authentication by google authenticator, in every directory that you want in just one step

README 文档

README

Build status: Build Status Scrutinizer Code Quality Code Coverage Build Status Latest Stable Version Total Downloads Latest Unstable Version License

The most powerful and the simplest library to add two factor authentication by google authenticator, for every directory that you want in just one step

  • Add two factor in different directory with different secret
  • Lock all pages and files until the correct code is inserted
  • Set automatically mod rewrite redirect to insert code page until the correct code is inserted
  • Update you htaccess automatically
  • Easily installation in each dir in just one step
  • Only one software installation location to allow you to manage it easily
  • You can always set up two factor in new directories without change other installations, keeping the same software installation location

#Constraints

  • httacces and mod rewrite needed
  • php write permission
  • the date time on the server must be synchronized (only 1 minute of margin)

#Download ##Get/update composer This library require composer (download composer here https://getcomposer.org/)

Update composer

php composer.phar self-update

##Download

Download via composer require (we suggest to create a dedicated directory for this)

php composer.phar require thecsea/twofactor-dir

or insert library as dependency in your composer project

thecsea/twofactor-dir": "1.0.*

in the last case you have to install or update you project

php composer.phar install

or

php composer.phar update

N.B. If you don't have access to server terminal you can perform installation on your pc and upload all via ftp

##Update twofactor-dir

You can update twofactor-dir (according to version limit set in composer.json)

php composer.phar update

#Use

##Installation You can set different different directory keeping only one software location, but you mustn't change it

###Set up twofactor-dir

  1. Give php write permissions to the directory where you want to set up twofactor-dir
  2. Enable htacces and mod rewrite
  3. open via a browser the following page and insert the directory position (preferably absolute link)

vendor/thecsea/twofactor-dir/files/install.php

after this you will see new files and htaccess updated

We suggest to hide via htaccess the twofactor-dir installation directory

###First Use You can get secret or QR code on YOUR_DIR/get_qr.php. We suggest to use a https connection

After linked a device we suggest to hide get_qr.php for not logged users in the following way:

CAUTION Comment RewriteRule ^get_qr.php$ get_qr.php [L,QSA] on htaccess generated after get qr for the first time, so you are able to get qr (to add more devices) only after login

##Use When you try to access to each page of the directory you will be redirected to insert code page, when you insert code you will be logged until the session is closed.

You can add new devices after login (insert code page) calling YOUR_DIR/get_qr.php

##Customize

Obviously you can customize interface modifying:

  • redirect.php
  • get_qr.php

##Disable You can disable twofactor-dir temporarily commenting the redirect instructions on .htaccess

##Uninstall To unistall twofactor-dir for a directory you have to remove the following files from your dir:

  • get_qr.php
  • redirect.php
  • secret.php

and remove the twofactor-dir lines (marked) from .htacces

CAUTION: You must keep the twofactor-dir installation (installation downloaded by composer) if you have set up it in other directories

Credits

#By thecsea.it

thecsea/twofactor-dir 适用场景与选型建议

thecsea/twofactor-dir 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 125 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 07 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Authentication」 「google」 「directory」 「two」 「factor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 thecsea/twofactor-dir 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 thecsea/twofactor-dir 我们能提供哪些服务?
定制开发 / 二次开发

基于 thecsea/twofactor-dir 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 125
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 30
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-07-22