Add TOTP authentication guide (#2196)#2226
Open
Thavamani13 wants to merge 1 commit into
Open
Conversation
|
Thavamani Murugan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Covers real-world use cases: basic 2FA login, payment step-up auth, secret source integration, time bias/token expiry handling, multi-account parameterization, and code verification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e685e96 to
9bd4915
Compare
codebien
reviewed
Apr 27, 2026
codebien
left a comment
Contributor
There was a problem hiding this comment.
@inancgumus as you developed the feature, can you review this guide, please?
inancgumus
requested changes
Apr 27, 2026
Contributor
There was a problem hiding this comment.
Thanks for picking this up! I'm reviewing this PR only from technicals. Some issues:
totp.gen(30, 30)generates the previous window's code. So, you'd needgen(30, -30)for the next window.TOTP.verify()says "a code generated by the library is accepted by the server." But the TOTP library regenerates a code locally and compares strings. It doesn't talk to any server.- The "Before you begin" section says clock drift of more than 30 seconds will cause failures. Whether that's true depends on the server (many accept adjacent windows).
@codebien I've technically reviewed this. Can you check the writing please? Thanks.
codebien
requested changes
Apr 28, 2026
codebien
left a comment
Contributor
There was a problem hiding this comment.
@Thavamani13 I'll continue the review as soon as you've addressed @inancgumus's request, so feel free to re-request a review as soon as you've pushed changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
totp-authentication.mdguide underdocs/sources/k6/next/examples/totpjslib API reference and secret source docs throughoutCloses #2196
Test plan
k6/http,k6/secrets,k6/data) and thetotpjslibweight: 04places the guide alongside other auth examples<!-- md-k6:skip -->annotation added to the bash CLI snippet to skip k6 execution in CI<K6_VERSION>placeholder used in all doc links (not hardcoded version strings)