apideck-libraries/postman-to-k6

How to pass oauth credentials

RakeshSharma04 opened this issue · 3 comments

Hi,

I am using command to convert postman collection with global variable file as

postman-to-k6 collection.json --global workspace.postman_globals.json -o k6-postman.js

but getting this "To convert this collection provide OAuth credentials. Either include them in the collection or use the --oauth1-* CLI options. Minimum required configuration is signature method, consumer key, consumer secret, access token, and token secret"

The login request generates login token using ID and password then this token is used in all the subsequent requests and passed as XML header.

In postman script I am storing the generated token as global variable and then passing this variable in each requests.

Please suggest what to do .

Thanks,

Hi @RakeshSharma04

Postman uses specific Oauth flow via an internal process, which cannot be mapped or convert into a K6 script.
To overcome this, we have documented some options, could you have a look to see if this works for you?
#54

You will see that the workarounds, generate a Postman Environment file, which will have Oauth tokens available as Postman variables to be used in your normal Postman requests.

Hi @thim81 ,

Thanks for the prompt answer, I will check the #54 , and see if it helps.

Thanks,