Auth TOTP#

该模块实现基于时间的一次性密码 (TOTP) 算法,并提供短时有效的一次性密码机制。

特性:

  • 使用 TOTP 的标准 HTTP 认证。

  • 在 TOTP 过期后基于 cookie 跟踪已认证客户端。

  • 可配置的密钥、时间基准、时间步长和截断长度,用于生成 TOTP。

  • 可配置的 TOTP 校验时间窗口。

安装#

安装 该模块,请使用以下软件包之一:

  • Angie:angie-module-auth-totp

  • Angie PRO:angie-pro-module-auth-totp

加载模块#

要使用该模块,请在 main{} 上下文中加载它:

load_module modules/ngx_http_auth_totp_module.so;

配置示例#

server {
    listen 80;

    location /protected {
        auth_totp_realm "Protected";
        auth_totp_file /etc/angie/totp.conf;
        auth_totp_length 8;
        auth_totp_reuse off;
        auth_totp_skew 1;
        auth_totp_step 1m;
        auth_totp_cookie "totp-session";
        auth_totp_expiry 1d;
    }
}

其他信息#

详细文档和源代码可在以下位置获取: 61131/nginx-http-auth-totp