# Post login action, call API with jwt encrypted data

**URL:** <https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [October 9, 2023, 12:31pm UTC](https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093 "2023-10-09T12:31:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kush1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kush1/32/73206_2.png) [@Kush1](https://community.auth0.com/u/Kush1)\
**Post date:** [October 9, 2023, 12:31pm UTC](https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093/1 "2023-10-09T12:31:00Z")

</div>

Hi, is this possible.

I’ve looked at both jwt-decode and express-jwt.

Scenario: to call an API from post-login script securely. The idea is to generate a JWT string from a JSON string and a secret, send to API using Axios. The API will decode the JWT string using the shared secret to obtain the JSON string.

Is there an available js/node package that can be used in a post-login action to sign a json string with a secret?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [October 9, 2023, 4:16pm UTC](https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093/3 "2023-10-09T16:16:12Z")

</div>

Hey @Kush1 !

> [@Kush1](#):
>
> Is there an available js/node package that can be used in a post-login action to sign a json string with a secret?

I recommend taking a look at the `jsonwebtoken` library - It should get you what you’re looking for 🙂

> **[GitHub - auth0/node-jsonwebtoken: JsonWebToken implementation for node.js...](https://github.com/auth0/node-jsonwebtoken)**
>
> JsonWebToken implementation for node.js http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html

---

<div class="post-metadata">

**Author:** ![Kush1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kush1/32/73206_2.png) [@Kush1](https://community.auth0.com/u/Kush1)\
**Post date:** [October 10, 2023, 7:17am UTC](https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093/4 "2023-10-10T07:17:19Z")

</div>

Hey @ty.frith , thank you. I thought I was bound by [Can I require? - Search which node modules you can use in webtask.io](https://auth0-extensions.github.io/canirequire/#jwt)

I missed adding the package as a dependency. Thank you for the reply, it helped me work it out 🙂

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [October 10, 2023, 6:45pm UTC](https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093/5 "2023-10-10T18:45:29Z")

</div>

Awesome, thanks for confirming!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 24, 2023, 6:46pm UTC](https://community.auth0.com/t/post-login-action-call-api-with-jwt-encrypted-data/118093/6 "2023-10-24T18:46:11Z")

</div>

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