# JWT Token Decoding Column

**URL:** <https://community.glideapps.com/t/jwt-token-decoding-column/72577>\
**Category:** Ask for Help\
**Created:** [April 14, 2024, 3:51pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577 "2024-04-14T15:51:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darko\_Vukoje](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darko_vukoje/32/73227_2.png) [@Darko\_Vukoje](https://community.glideapps.com/u/Darko_Vukoje)\
**Post date:** [April 14, 2024, 3:51pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577/1 "2024-04-14T15:51:55Z")

</div>

I am getting a response as JWT token that I need to convert to json to get the information.

Something like this:

> **[How to decode a jwt token in JavaScript - QuickRef.ME](https://quickref.me/decode-a-jwt-token.html)**
>
> In this Article we will go through how to decode a jwt token only using single line of code in JavaScript. This is a one-line Java

Tried with js column, using the sam js function like on the link, but never getting anything back. Is there any tested glide column that does this?

Thanks,  
Darko

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 14, 2024, 4:09pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577/2 "2024-04-14T16:09:44Z")

</div>

Are you using a return to return the value? I can get it to work with this.

```auto
const decode = token => decodeURIComponent(atob(token.split('.')[1].replace('-', '+').replace('_', '/')).split('').map(c => `%${('00' + c.charCodeAt(0).toString(16)).slice(-2)}`).join(''));

return decode(p1);

```

---

<div class="post-metadata">

**Author:** ![Darko\_Vukoje](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darko_vukoje/32/73227_2.png) [@Darko\_Vukoje](https://community.glideapps.com/u/Darko_Vukoje)\
**Post date:** [April 14, 2024, 5:08pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577/3 "2024-04-14T17:08:52Z")

</div>

I did. This is strange. You used exactly this code. Could you please send me sample data? Thx

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 14, 2024, 5:45pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577/4 "2024-04-14T17:45:57Z")

</div>

I used the same string of data that was include in the sample you linked to.

```auto
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
    eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0I
    joxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

```

---

<div class="post-metadata">

**Author:** ![Darko\_Vukoje](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darko_vukoje/32/73227_2.png) [@Darko\_Vukoje](https://community.glideapps.com/u/Darko_Vukoje)\
**Post date:** [April 14, 2024, 6:14pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577/5 "2024-04-14T18:14:59Z")

</div>

> [@Jeff\_Hager](#):
>
> ```auto
> const decode = token => decodeURIComponent(atob(token.split('.')[1].replace('-', '+').replace('_', '/')).split('').map(c => `%${('00' + c.charCodeAt(0).toString(16)).slice(-2)}`).join(''));
> 
> return decode(p1);
> 
> ```

Thanks, I recreated the column and pasted your code and it works fine now. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 21, 2024, 6:15pm UTC](https://community.glideapps.com/t/jwt-token-decoding-column/72577/6 "2024-04-21T18:15:09Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
