I did use PHP execute, then did a Base64 encode on it, and then cleaned ‘+’, 
‘/‘ and ‘=‘.

Still got an invalid signature. 

With the ’True’ parameter, the php function returns binary; often this is empty.
With the parameter set to false, you get what they call ‘lowercase hexies’. No 
clue at all what that means.

The signature is still invalid according to jwt.org <http://jwt.org/>

I will give Miyako’s plugin a try, although I would have preferred to avoid 
plugins.



> On 20 Mar 2020, at 18:10, JBellos via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi, 
> 
> I had to spend some time looking into this recently myself. You have two
> options:
> 
> 1 - K. Miyako has a plugin - CommonCrypto. Easy to use.
>       $signature:=HMACSHA256 ($keyData;$stringData;Crypto BASE64)
> 
> 2 - Use PHP execute, but then encode the result (assuming you need to)
>         php way if we ever need it - do not delete
>         $phpOK:=PHP
> Execute("";"hash_hmac";$sigBlob;"sha256";$stringToSign;$key;True)
>         BASE64 ENCODE($sigBlob)
>         $signature:=Convert to text($sigBlob;"utf-8")
> 
> 
> 
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to