Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Passing Authentication via HTTP Web Request

Posted on 2010-11-12
9
Medium Priority
?
615 Views
Last Modified: 2012-05-10
I have created an application updater that goes out to a website, downloads a manifest and then via httpwebrequest starts downloading files.  Everything works as it should.  I then decided to add a layer of security and placed a password on the directory.  When you open up a browser and browse to the url you are now prompted for a username and password.  

My question is how can I pass the username and password to my webrequest so the update continues without end user intervention?  This is not on a  network(no AD), I am assuming the website is using basic authentication.  

when i use this method My.Computer.Network.DownloadFile("http://updates.we bsite.com/updates", strManifest, username,password) it works fine.  

Please can you show me how to accomplish this?
0
Comment
Question by:MotherTrker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 1

Accepted Solution

by:
MotherTrker earned 0 total points
ID: 34132715
I have figured this out on my own, for anyone else that is having this problem the below worked for me.  VB.Net 2008

            theRequest = WebRequest.Create(URL)
            theRequest.Credentials = New NetworkCredential("username", "password")
            theResponse = theRequest.GetResponse
in the above order.  This is hitting a site with basic authentication.

Hope this helps someone, i spent a couple days trying to get this to work.
0
 
LVL 19

Assisted Solution

by:Shahan Ayyub
Shahan Ayyub earned 2000 total points
ID: 34132716
0
 
LVL 1

Author Comment

by:MotherTrker
ID: 34132723
i figured it out on my own
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 19

Expert Comment

by:Shahan Ayyub
ID: 34132728
No problem. The link has the same content.
0
 
LVL 1

Author Comment

by:MotherTrker
ID: 34132731
Shahan,
I bet I was closing this as you were typing.  Thank you for the pointer, I was able to get this working prior to.  Had you been a bit quicker I would of awarded you some points for posting. I am not sure If I still can be if so, i will make it happen.

Thanks.
0
 
LVL 1

Author Comment

by:MotherTrker
ID: 34132737
Sahan deserves points on this, I was able to figure out the solution but Sahan pointed me to a great article that would help out anyone attempting to do the same.  Please award him points
0
 
LVL 1

Author Comment

by:MotherTrker
ID: 34132746
Thanks Sahan
0
 
LVL 19

Expert Comment

by:Shahan Ayyub
ID: 34132757
I just see this question and I had the link I posted to you. So when I posted I see another comment on the same time :)

You have already posted an objection which can leads to give points to me. Thank you for consideration.
0
 
LVL 1

Author Closing Comment

by:MotherTrker
ID: 34171306
Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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