I’m using the Oauth2 Helper Tool to generate a token manually at the folder level, and I’ve set the requests in the folder to inherit the auth from the parent. Those requests do say “This request is using OAuth 2.0 from folder ”. And when those requests are run individually through the UI they work fine.
However, running the entire folder using the Postman CLI, those requests all return 401s. I’ve deleted and generated tokens immediately before using the CLI, but nothing can get them to work.
This seems like pretty basic functionality that I can’t even find any valid documentation for - Postman has docs for obtaining a token via the UI (which I already can do) but no docs for obtaining or using a token via the CLI.
Can someone please either let me know if what I’m asking is not supported, or if Postman offers a way to do this?
Thanks - is there any hope of programmatically generating tokens? Even the helper tool hides all the rest calls it makes so I can’t duplicate that functionality. This means that I have to manually get a token in order to use the CLI at all, which severely hampers automation efforts.
Hi @dougleenhoutsvivint. I would love to get your opinion on how you expect this workflow to be modelled.
It’s extremely difficult to replicate the behaviour of the OAuth 2.0 helper on the CLI. This is because of the authorization grant step required. A user need to be directed to an OAuth screen where they authenticate the client and are redirected to a redirect_uri. All of these have to be manual and can’t be replicated on a CLI.
If this step is included in a CLI, it would require a manual process defeating the purpose of automation. You’re required to only authenticate once, and we auto-refresh the token for you. This token can be stored in an environment variable which is usable on the CLI.