Forum Discussion

All_Data_Suppor's avatar
All_Data_Suppor
New Contributor
15 years ago

Cannot connect to an authenticated REST Server through HTTP/REST Request

Hi,

2 Months ago we were able to connect to an authenticated REST Server (web page) using only the HTTP Test Request with the authentication and security-related settings. It worked just fine.

Now the Server has the authentication on a web page, not on a pop up screen (as it used to be and worked just fine with SoapUI), but now it's on an apparently simple Web Page form. Since then we just keep getting a message:

Please enter your username and password.

and therefore, the authentication and security-related settings don't seem to work any more. Is there something else you might recommend me to do for this new scenario?

I'd really appreciated.
Thanks in advance and regards,

Igor

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    You can try doing this with two requests now. The first one will enter the username and password and submit the form, you should then get a token (cookie) which you then use to connect to the service (it will automatically be stored if you select "Keep Session" in the TestCase options)

    I hope that helps,
    /Nenad
    http://eviware.com
  • Hi Nenad,

    I tried to do what you mentioned. It seems the Web Services product we're connection to, doesn't handle cookies until a log on session completes successfully.

    So, on the first request, we just get a header response like this:

    HTTP/1.1 401 Unauthorized
    Content-Type: text/html
    Date: Thu, 23 Jul 2009 16:22:27 GMT
    WWW-Authenticate: Custom realm="ADWS"
    Accept-Ranges: bytes
    Server: Noelios-Restlet-Engine/1.1.4
    Transfer-Encoding: chunked

    So, there's no way of passing over the cookie values you mentioned to the next test request. Would you please let me know what else I could do?

    Thanks in advance,
    Igor