Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SHA256 for Authentication
Message
From
20/12/2021 21:18:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SHA256 for Authentication
Miscellaneous
Thread ID:
01683030
Message ID:
01683030
Views:
127
HI All,

Just wondering if anyone ever coded the authentication header for USAePay API.
I tried using vfpencryption.fll but the results did not come out correct.

Here is the javascript code that works:
var seed = "321456789012345678901234567890";
var apikey = "_fCzX0t0vP310Vn0rKzVEij4zSBb7g0j";
var apipin = "J105251T";
var prehash = apikey + seed + apipin;
var apihash = 's2/'+ seed + '/' + SHA256(prehash);
var authKey = new Buffer(apikey + ":" + apihash).toString('base64');
var authKey2 = (apikey + ":" + apihash).toString('base64');
console.log("Authorization: Basic " + authKey);

https://onecompiler.com/javascript/3xh8rx8pr

My attempts to replicate this in VFP did not work.

Thanks
Joy Tan
Next
Reply
Map
View

Click here to load this message in the networking platform