Skip to main content
November 19, 2011
Question

MMHttp.getText() with basic authentication

  • November 19, 2011
  • 1 reply
  • 4134 views

Hi All,

I am creating a Dreamweaver Extension that pulls data from a website. I use MMHttp.getText() to retrieve a URL and the website uses basic authentication.

How do I specify username and password for MMHttp.getText() method?

I have tried using https://username:password@www.... type URL but still does not work.

Thank you.

Regards,

Nugroho

This topic has been closed for replies.

1 reply

Participating Frequently
November 21, 2011

The MMHttp object is very basic, if changing the URL didn't work (assuming it does work as expected when you try that same URL in a browser), then that type of authenticaion is likely not supported. Does it work with the HTTP (as in not HTTPS)? I believe that HTTPS support was added a couple of versions ago, so it's possible there are some limitations along that line.

Danilo Celic

November 22, 2011

I have tried the URL (that contains username and passowrd) in a browser and it works but it does not work using MMHttp.

Regarding HTTPS support, I tested using MMHttp to non-authenticated HTTPS  website and its works.

Participating Frequently
November 22, 2011

If HTTPS is supported on your site, then it looks like you should pass the user name and password in via the query string of the URL you're using and check the values on the server to allow returning of the content, or maybe think about using MHttp.postText() instead to pass the user name and password as posted values, that way the values aren't in the URL itself. Based on what I've read, the query string values aren't readable by thrid parties.

Danilo Celic