Skip to main content
Question

How do I construct the JWT Assertion in Google App script?

  • May 21, 2025
  • 1 reply
  • 12 views

Forum|alt.badge.img

Hello,

 

I'm having a lot of trouble trying to construct the JWT Assertion for a Google Sheets script. I created a public key and added it to my app in Box, but I don't know how to go from there. I can't find any information about it or even what libraries can handle that.

 

Also, do I need to construct the JWT Assertion every time I request a token or I can reuse the same assertion?

 

Thanks in advance.

1 reply

Forum|alt.badge.img

There are many libraries available here as well as SDKs to handle JWT assertions. I would suggest using one that has a lot of usage and good documentation on how to use the library.

 

JWT Assertions used with the Box API require the "exp" (expire) claim and can be set to a max of 60 seconds, though it recommended to set it to less than the maximum. So yes, you should be creating a new JWT for each access token request. However, access tokens are valid for 60 minutes so you really don't have to be creating JWTs very often.

 

hope that helps.