16

I have the following endpoint: http://millennium.iwise.com.br:6017/api/millenium_eco/Tabelas_preco.lista

If I try to open via browser, it asks me credentials and then works fine - as seen on image below.

user: OData

password: 0d@t@123

enter image description here

If I send the same GET request using POSTMAN or SOAPUI I get 401 Unauthorized.

enter image description here

What I am missing here? Thank you in advance.

UPDATE:

I took the browser's header request and used the same in POSTMAN and I'm still receiving 401 Unauthorized. Is there a possibility of the endpoint's server is configured to reject all but browser's request?

enter image description here enter image description here

Victor Viola
  • 575
  • 1
  • 4
  • 14
  • 1
    I can see an NTLM Authorization header in your browser request. How do you configure your authorization in POSTMAN or SOAPUI? I see in POSTMAN you send Basic authentications. – k.liakos Mar 23 '16 at 20:26
  • @k.liakos Yes, you are right. I found someone with similar issue. Thank you for the tip. I will try to find a solution to do this authtentication in postman/soapui. If you have an idea, please share. – Victor Viola Mar 24 '16 at 11:47
  • 1
    I found this https://www.soapui.org/oauth2/reference/ntlm.html for SOAP UI, but it requires an extra domain to use for NTLM challenges, which you have not provided. Are you aware of something like this? – k.liakos Mar 24 '16 at 11:49
  • I am not aware about it but I appreaciate your help. I will try to find a way. Thank you! – Victor Viola Mar 24 '16 at 11:55
  • @k.liakos I'm trying to understand how the browser do this authentication. I do not send any domain information and the browser is able to handle the request properly. Do you have any idea? Perhaps something like "default domain"? – Victor Viola Mar 24 '16 at 12:29
  • Never heard of NTLM actually until I came across this post. Google around, maybe you'll find something. One easy appoach would be to assume the same domain you send the request is also the challenge domain. Try it and maybe you'll get lucky. – k.liakos Mar 24 '16 at 14:01
  • @k.liakos Thank you and have a nice day. – Victor Viola Mar 24 '16 at 14:17
  • @VictorViola - did you find a solution on your problem. I am facing the same problem. I can access a webservices in the browser with basic auth, but can't access the data when using Postman or any other client. - I am getting a 401 aswell. – Bernd Loigge Feb 15 '17 at 06:41
  • Hi there @öbl. Yes, I found it but not using Postman nor SoapUI. I had to implement a Java class to handle the NTLM Authentication. – Victor Viola Mar 09 '17 at 13:19
  • Sign out current account and restart postman worked for me. – Rajesh Kharatmol Jul 11 '23 at 04:56

15 Answers15

14

I got the exact same issue, requests working from the browser but not using postman.

Since postman syncs across devices, it maintains lot of cache info I believe. I clicked on my profile in the app and signed out from all the devices. I then started the app, did not sign in , I clicked on the "continue without signing in option" which is a link close to the bottom on the sign in page. Then I was able to run the requests via postman.

I then signed in and things were fine via postman.

Note: I always had the SSL certificate verification Off in setting for the request.

Pingo
  • 141
  • 1
  • 5
6

I have also faced the same issue. It is working from my browser exactly when I provide the user name and password in the prompt window.

I resolved it by using the 'authorization' tab and select authentication type 'Basic Authentication' in the postman.

Postman Screenshot

Saghir A. Khatri
  • 3,429
  • 6
  • 45
  • 76
Jayed Ibrahim
  • 61
  • 1
  • 2
  • That solved it for me as well! Also works when selecting Bearer Token as authentication method. Thank you! – flocbit May 10 '22 at 08:59
4

Sign out your current account and make sure checking Clear local data and re-login.

Wei Zhong
  • 157
  • 1
  • 3
3

Try to go Postman Settings > And turn SSL verification Off

It will allow you to send/ receive request/ response from unsafe URLs

PostmanSettings

WINSergey
  • 1,977
  • 27
  • 39
Akshay Patil
  • 31
  • 1
  • 2
3

I solved this problem by replicating the exact network call in postman. NOT by going into the network tab and manually copying headers etc. by copying the whole request into postman using a different way.

I highly recommend reading this article and giving this a try once.

How to replicate requests from the Chrome Network Tab into Postman

Abdul Malik
  • 1,158
  • 6
  • 15
2

In my case it was due to I have a white space at the end of the url (invisible for me, copy and paste from the browser and may inadvertently added a white space there). Took me a while to find out. It seems like a small bug on Postman side.

uudaddy
  • 341
  • 4
  • 9
  • This got me looking in the right place, I had a double slash in my URL. My variable ended with a slash, but also I added a slash in the address bar. e.g. https://localhost:8080//api/some-resource – dru_ward Jul 20 '21 at 14:44
1

I was having the same issue and didn't find any solution but it worked once I signed in from another postman account by deleting all the local data of postman. I do not have any idea about why that happened but it looks like it was some kind of setting that I had that caused this issue. I would recommend deleting local data and reset the postman setting if you are a beginner like me and have no idea what's going on.

Delete local data from postman: https://support.postman.com/hc/en-us/articles/4410785125271-How-to-remove-local-data

Saurav Panthee
  • 589
  • 5
  • 8
  • How do you delete all the local data of postman? – Bruce Seymour Feb 08 '22 at 17:52
  • In my case i always got "nothing matches given URI" Error as below, but the same URI worked in chrome : `

    Error response

    Error code: 404

    Message: Not Found.

    Error code explanation: 404 - Nothing matches the given URI.

    ` For this i followed to delete local data as guided above and used my google account to login postman. Now it works better .
    – Ravikiran R Jan 30 '23 at 03:22
1

I faced the same issue, solved it by using NTLM Authentication in postman. You can find it in Authorization tab in postman

https://i.stack.imgur.com/eRMAT.jpg

Muhammad Safwan
  • 869
  • 7
  • 12
1

Download the Postman desktop app and try from there. The Postman website sending requests to localhost:5001 won't route correctly. You could setup a port forward on your router to your local machine, but easier to get the desktop software.

I had the same issue above and this this approach worked.

Bruce Seymour
  • 1,520
  • 16
  • 24
1

My suggestion would be check the network tab of the chrome and check all the request headers, then, disable all the headers in the postman and apply/copy individual header. For me the problem was - I was passing Accept: "/" from postman, while I got to accept "text/html"

enter image description here

Sandeep Gantait
  • 837
  • 8
  • 9
0

Without even signing in i got the same error. I deleted all the history of postman and ran it again , it serves the purpose.

Makarand
  • 477
  • 1
  • 7
  • 17
0

Click on this link

Go to settings->turn off ssl certificate

Fayazz B N
  • 117
  • 1
  • 2
  • In my case, SSL was already off so it didn't help. But here's what fixed for me https://stackoverflow.com/a/76750982/11306308 – Tushar Sharma Jul 24 '23 at 01:49
0

Mine was failing because I didn't have www in the url. After adding the www to the url mine was successful using Basic Auth

crokadilekyle
  • 80
  • 1
  • 8
0

I faced same issue. My GET request works with browser, but not POSTMAN (or INSOMNIA) if using bear token.

However when I changed to Basic Authentication, it works as normal.

I found the issue is due to my setting.py files (Im using DRF) not mention TokenAuthentication

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 15 '23 at 12:11
0

I encountered a similar error

enter image description here

The above was working completely fine on the browser tho. Basically, when I tried to visit the URL I will get the response on the browser but not on Postman or vs code thunder client extension.

I tried so many things like:

  • Changing the request timeout to 0 (infinity)
  • Toggling SSL Certifications.
  • Clearing cache.
  • Signing out from Postman and then trying without signing in.

None of which worked.

I think it has to do something with the firewall.

To fix this. What I did was to use the postman web app. It works completely fine there. Post and Get request both. Give that a try.

starball
  • 20,030
  • 7
  • 43
  • 238