web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to decode jwt toke...
Power Automate
Answered

how to decode jwt token with power automate

(1) ShareShare
ReportReport
Posted on by 8

Hello, I need to decode one jwt token with power automate, like this:

LuisBa_0-1670540168342.png

thank you

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @LuisBa ,

     

    Please try:

    vbofengmsft_0-1670556309540.png

    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)))))
    ))

     

    vbofengmsft_1-1670556379034.png

     

    Best Regards,

    Bof

     

  • LuisBa Profile Picture
    8 on at

    Hi @v-bofeng-msft  many many thanks it's working, really many thanks.

  • CWilkinson Profile Picture
    25 on at

    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

  • rjwales Profile Picture
    on at

    Did you ever manage to figure out how to do this?

  • CWilkinson Profile Picture
    25 on at

    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

  • CU26090717-1 Profile Picture
    2 on at
    Thank you for this post.  It was a real life saver for me.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard