Newman Authentication Error

I’m having an authentication issue running Postman tests via Newman.

I’ve created a test suite with variables to populate each environment - long story short, all tests pass when I run them in the Postman app:

image

Yet, when I run the same collection from Newman (either exported to file or from URL) with the relevant env variables exported, the tests fail (ignore the middle one - it always passes, it’s just to confirm the env under test):

image

So I amended the tests to console.log the response body, and it returns this (from Newman only):

image

Yet, in the Postman app, no authentication is needed…
image

Any ideas?

Thanks,
Adam

Please check in your list of environment Variables, maybe username or password fields you are declared in env variable and getting some variable from Collection variable or global variable and same name variable you left blank in env variable it will create the problem. Plz, verify.