For times when you need to keep things from your users

(1.5FA) time-based almost-one-time password algorithm… :grin:

def oneTimeAuthorize():
	resultString = system.net.httpGet("https://api.coindesk.com/v1/bpi/currentprice.json")
	resultPy = system.util.jsonDecode(resultString)
	btcpi = int(resultPy['bpi']['USD']['rate_float'])
	answer = system.gui.passwordBox("COINDESK BTC PI","Enter Password",'$')
	try: 
		if int(float(answer))==btcpi: 
			return True
		else:
			return False 
	except:
		return False

You know this forum is public, right? :wink:

… and the user that finds this I will train in Ignition.

Why not just use a real TOTP authenticator, based on RFC 6238? Here is an example window.

Note, if you want this in production, the authenticator secrets need to be persisted per user, and the code will have to change a bit (There is no need for the Authenticator class to hold onto any keys, they get fed in during the check_code method).

If you have any questions let me know.
prime_totp_2017-10-22_1902.proj (13.7 KB)

2 Likes

Thank Kyle, that’s very helpful.