You are not logged in.
Pages: 1
Didn't notice the URI, you're right.
The following code works fine:
procedure TForm1.btnGeneraCodiceClick(Sender: TObject);
const
SECRET_KEY: RawByteString = 'myPrivateKey12345!!';
var
sData,
sSignature64: RawByteString;
SHAOutput: TSHA1Digest;
begin
sData := 'POS-1|2025-01-25|43';
HmacSha1(SECRET_KEY, sData, SHAOutput);
sSignature64 := BinToBase64(@SHAOutput, 20);
end;
Thanks
Hello,
I'm using Delphi 7 and mORMot2.
This code:
procedure TForm1.btnGeneraCodiceClick(Sender: TObject);
const
SECRET_KEY: RawByteString = 'myPrivateKey12345!!';
var
sData,
sSignature64: RawByteString;
SHAOutput: TSHA1Digest;
begin
sData := 'POS-1|2025-01-25|43';
HmacSha1(SECRET_KEY, sData, SHAOutput);
sSignature64 := BinToBase64URI(@SHAOutput, 20);
end;
returns in variable sSignature64 the value
AwxPbTUf5OGaFaxmmV6HwgpA0wU
which have a lenght of 27 chars.
The following code executed in Postman:
var CryptoJS = require('crypto-js');
var secretKey = "myPrivateKey12345!!";
var dataString = "POS-1|2025-01-25|43";
var signatureBytes = CryptoJS.HmacSHA1(dataString, secretKey);
var signatureBase64 = CryptoJS.enc.Base64.stringify(signatureBytes);
console.log("signatureBase64: ", signatureBase64);
returns in variable signatureBase64 the value
AwxPbTUf5OGaFaxmmV6HwgpA0wU=
which have a lenght of 28 chars.
I can't figure out if I wrong something in my code, or if there are some issues in the code.
I found the same behaviour also in mORMot 1.
Can you point me in some directions to solve my problem ?
Thanks in advice, regards
Giuseppe Garzotto
Yes, one minute after submit I found what I need in another post.
Ctxt.Call.InBody solve all my needs.
Thanks
I have defined a method based service.
I need to perform a POST call from a client (initially Postman, in production will be an Angular application).
I would like to read entire body of the call, that will contain a complex JSON that I need to parse.
How can do it ?
Thanks in advice
Pages: 1