cwhitty

Struggling with CryptAuthCode function

Discussion created by cwhitty on May 16, 2017
Latest reply on Jul 24, 2017 by Alchemist

Hi,

 

Im reasonably new to Filemaker so bear with...

Im trying to generate a hmac to send to an API Server required for activating sims.

 

Currently I can create what i need using the Base elements plugin;

 

Lower ( BE_HMAC ( $DATA ; table::secretkey ;  BE_MessageDigestAlgorithm_SHA256; "" ;  "" ) )

 

returns

 

1a162ad9f68ea18ff6313c6efe8b531ef0998cfb1915e8d0c420f0f1f9736f18

 

where

 

$DATA = "lower=&20upper=113&tariff=8&nickname=&tags=Chris Whitfield"

 

But as scripts to activate sims will be ran via Webdirect and Filmmaker app I can't see it working and would rather use what is already in filemaker.

 

So Ideally i would us the new crypt auth code function but it seems to return a file called hmac.data

 

So to try and get the hmac retuned as text rightly or wrongly i tried this;

 

Base64Decode ( Base64EncodeRFC ( "4648" ; CryptAuthCode ( $DATA ; "SHA256" ; table::secretkey ) ) )

 

result:   *������1<n��S ����  ��� ���so

 

Any help will be greatly appreciated.

Outcomes