base64-encode()

Posted by goo on 20-Aug-2018 07:18

11.7

I am trying to send a authorization header and are making it by doing this:

DEF VAR my64 AS LONGCHAR NO-UNDO.
DEF VAR rawAuth AS RAW NO-UNDO.
PUT-STRING(rawAuth,1) = 'oidc_yyy_xxx' + ':' + 'xxxx-c97e-4f71-9f2a-b1da382b42ad'.
my64 = BASE64-ENCODE(rawAuth).
If I compare it With the one I get from Postman, the last character is 'A' on this, but Postman has '=' instead of 'A'. 
I probably does something wrong, but … not sure what.

Posted by benBuckley on 21-Aug-2018 14:24

HTTP Authorization uses a variation of base64, since certain characters used have special meaning in URLs.

Specifically, "+" becomes "-", "/" becomes "_", and "=" is not included at all.

All Replies

Posted by goo on 21-Aug-2018 11:43

I found out what was the problem.

Posted by benBuckley on 21-Aug-2018 14:24

HTTP Authorization uses a variation of base64, since certain characters used have special meaning in URLs.

Specifically, "+" becomes "-", "/" becomes "_", and "=" is not included at all.

This thread is closed