Hi all, I’m just starting with UI Performance testing with k6 and I want to integrate MFA/OTP in one of my tests
I have a secret key, which I can use to generate the OTP code and use it in my tests
I can use the following function:
export function generateTOTP(secretKey) {
// Create TOTP instance
let totp = new OTPAuth.TOTP({
algorithm: ‘SHA1’,
digits: 6,
period: 30, //If this is changed, the OTP is not working anymore
secret: OTPAuth.Secret.fromBase32(secretKey)
});
// Generate and return OTP
return totp.generate();
}
But k6 does not support it:
ERRO[0000] GoError: The moduleSpecifier “otplib” couldn’t be recognised as something k6 supports. hint=“script exception”
ERRO[0000] GoError: The moduleSpecifier “otpauth” couldn’t be recognised as something k6 supports. hint=“script exception”
What can I use (or how)?
Also, if this is not a good channel to ask this question, please let me know in which channel
Thanks!
1 post - 1 participant