Hello, I need to decode one jwt token with power automate, like this:
thank you
Hi,
Yes, but it wasn't something we could do in Power Automate alone, we had to develop it in Azure Runbook Automation and use a Power Automate to capture the token and use that inline with the service we needed.
Thanks,
CWilkinson
Did you ever manage to figure out how to do this?
Hi @v-bofeng-msft ,
I wasn't aware you were able to decode using a variable in Power Automate.
In theory, are you able to encode a JWT using Power Automate if you know the header, payload and security key? (pre-defined variables).
If so, are you able to provide any assistance with this please?
Thanks,
Connor
Hi @v-bofeng-msft many many thanks it's working, really many thanks.
Hi @LuisBa ,
Please try:
json(if(
equals(mod(length(split(variables('JWT Code'),'.')[0]),4),0),
decodeBase64(split(variables('JWT Code'),'.')[0]),
decodeBase64(concat(split(variables('JWT Code'),'.')[0],take('===',sub(4,mod(length(split(variables('JWT Code'),'.')[0]),4)))))
))
json(if(
equals(mod(length(split(variables('JWT Code'),'.')[1]),4),0),
decodeBase64(split(variables('JWT Code'),'.')[1]),
decodeBase64(concat(split(variables('JWT Code'),'.')[1],take('===',sub(4,mod(length(split(variables('JWT Code'),'.')[1]),4)))))
))
Best Regards,
Bof