How to run a CLI command to retrieve jwt token

Hi Everyone,

I have a question. My scenario is I have already manual set up which generates JWT token in my local mac terminal. But what I want to do is instead of running that CLI command in mac terminal to generate a token.

Is there any way I can run that CLI command in postman pre-script and retrieve the token from terminal something like that?

So instead of using local CLI terminal I want to use postman to run that CLI command and retrieve the JWT and pass it on to my other requests. Can someone please help on this?

I have seen other posts but all I saw is how to pass JWT token to other requests through pre-script but not running and generating JWT using CLI command.

Hey @koutharapu.usedu :wave:

Welcome to the Postman Community! :postman:

What command are you using in the terminal to generate the token?

I am running this command

“ java -jar wsTokenGenerator-1.3.*. jar jwt.properties”

You can ignore that * I am just trying to mask the version just for here.

Unless that terminal command triggers an API call to a resource that returns a JWT as the response - You’re not going to be able to do that in a Postman request.

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