问题标签 [totp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
23 浏览

node.js - TOTP MFA时间不同步

我的一些客户的设备的本地时间(在他们的智能手机甚至笔记本电脑上)与全球时间不同步 40 秒 - 提前 2 分钟或全球时间之前。因此,Google Authenticator 会显示未来或过去的代码。我的服务器与全球时间同步,所以问题出在客户端设备上。

是否有任何库/工具/技巧来应对?我使用 node.js。

在此先感谢您的时间。

0 投票
0 回答
44 浏览

amazon-web-services - AWS.config 和 AWSConfig.config 有什么不同(AWS cognito)

我正在使用 Cognito 创建关于登录 OTP 页面(我们的项目登录系统已经使用 Cognito 用户池)

我坚持 Cognito OTP 工作

[这是我的行动历史]

  • 我当前的 Cognito Userpool MFA 设置:“可选”
  • 节点.js
  • 登录逻辑已创建。[我们的项目模块使用如下]
  • 登录逻辑完成后,调用 AWS Cognito TOTP API 启动 MFA AssociateSoftwareToken()
  • 当我使用“AssociateSoftwareToken()”时出现错误 CredentialsError: Missing credentials in config
  1. 所以我插入了一些代码来修复这个凭据问题,如下所示,并且发生了另一个错误。

Amazon Cognito 的用户池 - CredentialsError: Missing credentials in config -> 此评论说需要 AWS.config 和 AWSConfig.config 设置。

  1. 但是错误显示ReferenceError: AWSCognito is not defined 我知道 AWS.config 是从 aws-sdk 模块提供的,但是我该如何解决以提供 AWSCognito ?请帮忙
0 投票
1 回答
88 浏览

ldap - 在 Keycloak 中为联合用户启用 OTP

我有一个外部身份提供者(OpenLdap 或 AD)。我将 Keycloak 配置为联合来自 Ldap 服务器的用户。我想为这些用户启用 OTP 流,而不是将它们引入 Keycloak 的数据库中。有什么方法或程序可以做到吗?

0 投票
0 回答
28 浏览

authentication - 使用 pytotp 进行 otp 验证有问题吗?

我正在使用 pytotp 和烧瓶。

这是我的基本代码

现在,为了检查我的秘密和 otp 是否与生成的相同,我打印了它们.. 一切都是一样的。但是 pytotp 没有验证 otp。 我的方法有问题请告诉我实现pyotp的正确方法。我正在从改造 android studio java 向烧瓶发送请求。谢谢你帮助我!!

0 投票
0 回答
92 浏览

node.js - node.js 中 2FA 的 infobip api 集成

如何在 node.js 中使用 infobip 使用 2FA(在注册期间获取 otp)?我必须在注册过程中使用 infobip,用户将获得 OTP 并验证其手机号码。

0 投票
0 回答
61 浏览

automated-tests - TOTP, 2FA 在柏树中进行测试,无需等待 30 秒

通常情况下,您会获得一次性 TOTP 令牌,并且需要等待 30 秒才能获得下一个令牌。这在测试中是不可接受的。有什么方法可以在测试期间跳过 TOTP 验证,或者您知道一些解决方案吗?

我正在使用柏树软件。

0 投票
0 回答
25 浏览

authentication - How can I authenticate a user on a device with no internet, using a QR code/mobile device?

I'm trying to design a solution to replace hardware keys. I have an application running on a device that will not have internet access, so it cannot authenticate itself, but could generate a QR code with url parameters that points to a web app that can then authenticate a user. How can I use this authenticated user to generate a token or passcode that can be accepted by the device?

My first thought was to use public/private key system. The webapp and device will both have the public key and use the url parameters as private key to generate a passcode if the user is authenticated on the webapp. But I don't think that would be secure, as the private and public key would be known and someone could just calculate the code themselves since they know both the public and private key... regardless of whether they are authenticated or not.

Am I going about this the wrong way? Any advice on how to handle this?

Edit: Picture below is my idea of auth flow... My question would be, what could the shared secret be? If it's passed in url parameters, then it's not secret, and they can calculate the code without being logged in.

enter image description here

0 投票
0 回答
164 浏览

docker - 使用 OTP 的 keycloak admin-cli 登录

我目前正在使用 keycloak 15.0.1 keycloak 容器,并且正在尝试为默认主域中的管理员帐户配置 TOTP 身份验证(谷歌身份验证器)。出于这个问题的目的,我将使用本地容器。

从 Web UI 登录时正确应用配置,但问题是使用 admin-cli 时

我正在使用以下命令登录 admin-cli:

这在没有 OTP 设置的情况下工作正常,但是当打开 OTP 时,我收到以下错误:

我尝试添加一些参数以防它接受它:

  • --totp=
  • --otp=
  • -totp=
  • -otp=

它没有用,我在 keycloak 文档中进行了搜索,但我找不到任何关于如何做到这一点的地方。

有没有人在使用 TOTP 时尝试并成功连接到 admin-cli?

0 投票
0 回答
38 浏览

totp - Yubikey TOTP 生成返回错误代码

我正在尝试从我的 YubiKey 5 NFC 获取当前的 OATH TOTP 代码:

不知何故,返回的值与 Yubico Authenticator 应用程序中显示的当前值不同。

什么解释了 TOTP 代码之间的区别?

0 投票
0 回答
24 浏览

pdf - 如何使用 PHP 和 OTP 通过 SMS 签署 PDF

我正在努力实现一个使用 PHP 签署 PDF 的系统。实际上我使用的是 TCPDFLib,但我需要这个过程:

  1. 使用 OTP 或基于时间的 OTP 向客户发送 SMS;
  2. 收到客户的 6 位数代码;
  3. 使用自签名证书和在 OTP 代码中发送的 SMS 对 PDF 进行签名;

我怎么能意识到这一点?