Forum Discussion

pv7721's avatar
pv7721
Occasional Contributor
10 years ago

REST application authentication in headers - not working

Hello,

I have to test a REST application for which the authentication scheme is to pass along a couple of specific headers (Password and Username) with each request.
For the most basic request, getting the system's date, I've added those 2 headers to be passed along (and I've noticed that they're automatically reordered alphabetically, thus Password is sent first.
The URL scheme is HTTP which gets redirected to HTTPS (self-signed certificate). I keep getting HTTP/1.1 401 Authorization Required while using SoapUI, whereas with a REST client in browser I get my result (and even the order of parameters doesn't seem to matter).
Can anybody point me to the right direction or tell me what I might be doing wrong?

Thanks!

4 Replies

  • pv7721's avatar
    pv7721
    Occasional Contributor
    Hopefully someone pointed me into the right direction: surprisingly, SoapUI doesn't handle well http to https redirection. So adding s after http in the Endpoint URL did the magic.
  • DChandran's avatar
    DChandran
    Occasional Contributor
    Hi,

    I am automating test scripts using SOAP UI Pro and the requirement is to get a 401 unauthorized error, but I am getting a contentType null / ContentType 0 as my response.

    I am using REST Service. When I try the same thing in POSTMAN it works fine and I got 401 unauthorized response.

    The URL and headers are the same in POSTMAN as well as SOAP UI but I don't understand why I am not getting a 401 response in SOAP UI.

    Can anyone please explain me why this is the case ?

    Your help is much appreciated.

    Thanks,
    Dhivya
  • pv7721's avatar
    pv7721
    Occasional Contributor
    Hi, even you "hijacked" my topic which was meant to be closed, as fixed, a couple of things:

    1) The URL you're using is HTTP (redirected to HTTPS) or directly HTTPS? In any case, what type of authentication do you use?

    2) You're a PRO user, so I guess you're entitled to support, isn't it so?
  • DChandran's avatar
    DChandran
    Occasional Contributor
    Hi,

    Thanks for your response.
    I am supposed to get 401 response but for some reason SOAPUI does not support this.
    All other responses are working fine except this because SOAPUI considers null content instead of 401 unauthorized response.
    The thing is we don't use any authentication to connect.
    So obviously I must get 401.

    And sorry to hack your POST , as I was not able to find New post I had to reply in the existing one.


    Thanks,
    Dhivya Chandran