Skip navigation
Currently Being Moderated

MMHttp.getText() with basic authentication

Nov 19, 2011 7:08 AM

Tags: #dreamweaver_cs5 #extension #mmhttp

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

 
Replies
  • Currently Being Moderated
    Nov 21, 2011 9:51 AM   in reply to nsaputro

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 21, 2011 7:07 PM   in reply to nsaputro

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 21, 2011 7:36 PM   in reply to nsaputro

    Yes I know, that's why I said in my response to check the values on the server. You can do a look up either in a DB or from some settings file.

     

    Danilo Celic

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 4:21 PM   in reply to nsaputro

    Which version of Dreamweaver are you working on, and which platform? I corresponded with a Dreamweaver engineer and they stated that it should be able to connect with basic authentication turned on for Windows versions of Dreamweaver, but probably not work at all on Mac. I set up my IIS7 on Windows 7 and set a folder on my localhost that was set to basic authentication and when I tried it the username and password dialog would appear. This would happen only the first time you access the authenticated URL in a Dreamweaver session; that is, once you close and restart Dreamweaver, and tried the URL again, the prompt would appear again. I tried this with and without the username and password in the URL and it always popped up a prompt dialog.

     

    One suggestion might be to try conntecting to the authenticated page via an XHR object within a mm:browsercontrol:

    http://help.adobe.com/en_US/dreamweaver/cs/extend/WS3825E1AD-223E-47e9 -B86B-ECFBCC45BE0C.html

     

    Search the Dreamweaver application configuration for examples of using the mm:browsercontrol, I beleive that the Spry Dataset Wizard uses that control.

     

    Danilo Celic

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points