I have to make an HTTP POST request to the URL http://example.com/test which contains the JSON string as a body part, headers "Content-Type:application/json" and "Authorization: Basic userid:password". userid is [email protected] and password must be 10-digit time-based one time password comply with RFC6238 TOTP using HMAC-SHA-512 for the hash function.
Token shared secret should be "[email protected]" without double quotations.
So, to achieve above I modified the Java code of RFC6238 RC6238 TOTP Algo
To get TOTP, I converted the shared secret "[email protected]" to HMAC-SHA512 using online converter tool as well some codes which generate the same 128 character length HEX code
Making the request always responses that "TOTP is wrong".
I noticed that I generated the wrong secret key, so there is the wrong TOTP. So, how can I generate the correct secret key that complies HMAC-SHA512 with Java code of RFC6238 algorithm?
There is default key as seed on the algorithm:
String seed64 = "3132333435363738393031323334353637383930" +
"3132333435363738393031323334353637383930" +
"3132333435363738393031323334353637383930" +
"31323334";
How can I get such seed64 for my shared secret "[email protected]"? My modified code is 10 digit TOTP
I appreciate help from everyone!