I am trying to decode a BASE 64
format token after getting it from object store but getting error in transform message.
Output after Object Store Retrieval
. This needs to be decoded.
eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiIxNzMzIiwiVXNlck5hbWUiOiJhY2hhbjAzMiIsIkN1bHR1cmVUYWciOm51bGwsImlhdCI6IjE1Njc2Njk3MDgiLCJleHAiOiIxNTY3NzU2MTA4IiwiaXNzIjoiVGltZVNoYXJlV2FyZSIsImF1ZCI6Imh0dHBzOi8vVGltZVNoYXJlV2FyZS5jb20vIn0.w2h6j7gbAs6CouE9WoYEDQRzBYEsNIqry70w2K4JAZg
%dw 2.0
import * from dw::core::Binaries
output application/octet-stream
---
fromBase64(payload as String) as Binary
ERROR MESSAGE:
Message : "Illegal base64 character 2e
5| fromBase64(payload as String) as Binary
^^^^^^^^^^^^^^^^^
Trace:
at fromBase64 (line: 5, column: 12)
at main (line: 5, column: 1)" evaluating expression: "%dw 2.0
import * from dw::core::Binaries
output application/octet-stream
---
fromBase64(payload as String) as Binary".
Error type : MULE:EXPRESSION
Element : authenticationflowtswFlow/processors/3 @ authenticationflowtsw:authenticationflowtsw.xml:30 (Transform Message)
Element XML : <ee:transform doc:name="Transform Message" doc:id="0cf3e737-e6a1-4d67-9a7c-60017db4ccf9">
<ee:message>
<ee:set-payload>%dw 2.0
import * from dw::core::Binaries
output application/octet-stream
---
fromBase64(payload as String) as Binary</ee:set-payload>
</ee:message>
</ee:transform>
I expect to get something like-
{
"alg":"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",
"typ":"JWT"}{"UserID":"1733",
"UserName":"achan032",
"CultureTag":null,
"iat":"1567669708",
"exp":"1567756108",
"iss":"TimeShareWare",
"aud":"https://TimeShareWare.com/"}0OVA`K
"L6+@f