Search code examples
postmanwindows-authenticationntlmnewman

Newman(Postman) - Import collection from a URL under windows authentication


I'm trying to run newman with postman collection from a url as mentioned in this link .

newman run http://localhost:62254/api/postman

Only catch is that the url is under windows authentication, so I'm getting a 401 Unauthorized response, causing newman to fail with below error.

the url "http://localhost:62254/api/postman" did not provide valid JSON data

I tried passing the credentials with the request like below. But it didn't work.

http://username:password@localhost:62254/api/postman

If I directly hit the endpoint with Postman using 'NTLM Authentication' feature it works fine. But I'm not sure if I can use this with newman to get the collection itself.


Solution

  • We were not able to find any option in Postman/Newman. So finally we made this URL alone (http://localhost:62254/api/postman) open to Anonymous Authentication in the web server.