[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Flash sendAndLoad with HTTP BASIC Authentication

Posted on 2005-05-02
6
Medium Priority
?
852 Views
Last Modified: 2008-01-09
Hello,

I am trying to figure out how to use Flash's sendAndLoad feature with a webpage that resides in a password protected directory.

Currently when I try to access the page directly from a browser, the browser prompts me with a username and password.

When I try to do a sendAndLoad from Flash to this same page, flash opens the same type of dialog box and i can type my password in and everything works, life goes on.

My question is how can i prefill the password so flash does not prompt me for one. In this case the username and password will always be 'admin'.

I've tried a few things such as formatting the URL like this:
http://admin:admin@192.168.1.1/secure/file.asp

but flash says it's not a valid URL.

I basically want to add my own headers to the HTTP call but I snooped some of the headers Firefox was sending and it does not send them in plaintext.

The only header that is added after i type the password is:
Authorization: Basic YWRtaW46YWRtaW4=

^Does that somehow relate to admin/admin?

I also looked up the LoadVars2 class which supports some form of user/pass but i could not get it working.

Is there another way to do this?

Maximum points to whoever can come up with a solution for me as soon as possible. Thanks!!
0
Comment
Question by:Aurora_Multimedia
6 Comments
 
LVL 5

Expert Comment

by:DavidCrossman
ID: 13911857
Aurora,

I don't have a web server available at the moment where I can test this, but here's a suggestion...

Use JavaScript to POST nothing to the ASP page, first. You can do this by writing your own JavaScript code to respond to an fscommand. In the JS code, you can use the admin:admin style URL.

After the JS code is called, put a brief delay in your Flash movie then call the SendAndLoad. The connection should persist.

Let me know how it goes. I should be in the office on Wednesday and I can test this as well.

Best of luck...

David
-=-
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 13912199
Something along this sort of line, I guess...  
http://javascript.internet.com/navigation/htaccess-login.html
0
 

Author Comment

by:Aurora_Multimedia
ID: 13912342
The javascript hack might work if this was a flash that was going to be on a webpage, however This will be in a Flash .EXE projector.

(I have to make it a .exe so I can use flash studio pro's functions.)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 37

Expert Comment

by:CyanBlue
ID: 13912384
I know you will get good help from the MDM people...  
They are really good at their stuff, and they should be able to give you some good solution...  ;)
0
 

Author Comment

by:Aurora_Multimedia
ID: 13912750
I tried this with no success:

this["upgradeIT"+currentipAddress].addRequestHeader("Authorization", "Basic YWRtaW46YWRtaW4=");
0
 
LVL 27

Accepted Solution

by:
negatyve earned 2000 total points
ID: 13912962
Have you just tried it with a projector created with flash studio?
To me this code, tested in an html page, or inside flash authoring, or on a swf alone, doesn't work:

data.sendAndLoad("http://admin:admin@localhost/secure/file.asp", data, "POST");

but do works if testes in a flash studio projector...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question