JWT Token > nbf value in future time - jwt not active error

InstaApps
New Member
2 0 3

Currently, we're using @Shopify/app-bridge > authenticatedFetch function (uses https://{{shop}}.myshopify.com/admin/internal/web/graphql/core?operation=GenerateSessionToken to get the JWT token) to make authenticated call (that includes the authorization header in HTTP request)

Server authenticates the request by verifying the JWT token - calls the Shopify.Utils.loadCurrentSession function, which fails since the JWT token #nbf field value is future time - any where from 3 to 17 seconds.

To avoid the failure, we have to wait for that duration before verifying JWT token -- similar issue reported @ https://github.com/Shopify/shopify-node-api/issues/137 

This causes longer wait / verification time when the app is loading and not a good experience for Merchant - especially for production app.

Any work around to not receive JWT token #nbf value with future time?? Is Shopify team aware of this and have solution for this problem??

 

Replies 3 (3)
awwdam
Shopify Staff
Shopify Staff
241 40 30

Hey @InstaApps,

I see you have linked a Git Hub Repo, and in this case a related issue. After some digging I wasn't able to find a direct workaround, but I would encourage you to engage in the repository - either posting in the related issue or even opening up a new one. We always suggest providing as much info about the tools your are using as possible, as well as troubleshooting, code blocks etc. 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

iozyigit
Shopify Partner
23 1 2

This might be joke. I am having same problem.

https://www.linkedin.com/in/ismailozyigit/
chefJuanPi
Shopify Partner
19 0 7

I had the same trouble using win 10, wsl ubuntu. I fixed installing chrony.  chrony is a service for auto update date and time,

sudo apt update
sudo apt upgrade
sudo apt install chrony
sudo service chrony start

 after that, you can validate the chrony sources:

chronyc sources

After that no more troubles with jwt.