Hello, I need help to generate a token key as a variable in PROOF via a provided java code (please see below), there is a provided .jar file that I am unable to attach in this forum request. Please let me know if we can set up a Goto Meeting for this, thnaks.
package gov.nih.era.erabase.tfa;
import org.jboss.aerogear.security.otp.Totp;
/*
When you set up an authenticator app with a website, that site generates a secret key
- a random collection of numbers and symbols - which you then save to the app. The
site usually shows you that key in the form of a QR code. When you scan that with the
app, the key is then saved to your phone. The key is available during initial setup only.
*/
public class Otp {
public static void main(String[] args) {
String otpKeyStr = "6jm7n6xwitpjooh7ihewyyzeux7aqmw2"; // <- this 2FA secret key.
Totp totp = new Totp(otpKeyStr);
String twoFactorCode = totp.now();
System.out.println(twoFactorCode);
}
}