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

Announcements

News and Announcements icon
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:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard