Generate an access token/JWT with curl
Greetings,
I have a bash script that generates some files.
I'd like to upload these files to Box using the same bash script and looks like it's super simple.
The one thing which confuses me is authorization...is it possible to use JWT method with just raw bash/curl approach to generate an access token. Maybe somebody has some examples?
Thanks
-
It is possible to generate an access token with a cURL request. We have some examples that are language specific that can be written in a more generic way, but you'll still need to handle decoding. I recommend reviewing these two pages from our developer documentation to help you get started.
https://developer.box.com/guides/authentication/jwt/without-sdk/
https://developer.box.com/reference/post-oauth2-token/ -
I gave up on JWT and ended up using just plain OAuth 2.0 with bash. If somebody interested: https://github.com/rooty0/box-oauth-uploader
-
I just realized that we are using a Private Key, so I HAVE to follow: https://developer.box.com/guides/authentication/jwt/without-sdk/
Would be great to have a bash example for this.
I am attempting this now with the help of this blog - https://willhaley.com/blog/generate-jwt-with-bash/
Please sign in to leave a comment.
Comments
4 comments