Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Token Refresh Not Working in Newman CLI When OAuth 2.0 Access Token Expires #3219

Open
maulikcoderoom opened this issue Apr 11, 2024 · 1 comment

Comments

@maulikcoderoom
Copy link

maulikcoderoom commented Apr 11, 2024

Running postman collection with Newman CLI , I noticed that after my OAuth2.0 access token timed out, refresh token was not automatically fetching for requests within the collection. Despite having set auto-refresh token and share token enabled, and exporting the collection to run with Newman. Each request inside collection was set to inherit auth from parent

What I'm seeking is to have each API request within the collection automatically fetch a new access token when the current one expires, while running the collection through Newman without manual intervention. Is there a way to enable share token for each auto-refreshed token so I can run collection with Newman CLI ?

  1. Newman Version : 6.1.2
  2. OS details (type, version, and architecture): Windows 11 64 bit
  3. Are you using Newman as a library, or via the CLI? : Newman CLI
  4. Did you encounter this recently, or has this bug always been there: Always there
  5. Expected behaviour:
  6. Command / script used to run Newman: newman run collection-name -e collection-env
  7. Sample collection, and auxiliary files (minus the sensitive details):
  8. Screenshots (if applicable):

Steps to reproduce the problem:
Step 1: Set Auth type OAuth 2.0 for collection
image

Step 2 : Enable Auto-refresh token and Share token for collection
image

Step 3: Add required token information under Configure new token section for collection

Step 4: Add refresh Request - Request URL for collection
image

Step 5: Set Authorization "Inherit auth from parent" for each request inside collection
image

Step 6: Export collection and environment and run with Newman CLI

@davidschwab
Copy link

I'm also seeing the same issue. The Auto-refresh Token functionality works from the Postman desktop app, but when exporting and running from Newman, an expired token does not automatically refresh. This is a blocker for automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants