Then parse the Json string now contained in decoded_key.
I imported Scott Klement’s BASE64R4 service program code a few years go and use that base64_decode procedure in RPG.
Also, you shouldn’t need to Cast your string to 1208. Once decoded it should BE 1208 already.
--
Chris Hiebert
Lead Software Developer
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jay Vaughn
Sent: Wednesday, March 5, 2025 11:50 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: base64 URL decode - for jwt
yeah this is definitely the piece I cannot hack.
I did a base64 encode in another project and before the encoding I'd
declare an rpg variable as varchar(256) and ccsid(1208)
then base64 encode would work fine.
but
base64_decode will result in a blob...
and even though I'm doing a...
set o_token = cast( qsys2.base64_decode(trim(i_token))
as varchar(2048) ccsid 1208);
It is still not legible. (even if I remove the ccsid 1208 - it is not
legible.
Daniel, are you able to reference any live code and tell me which part I'm
missing here?
thanks
Jay
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.