?
Solved

Passing Authentication via HTTP Web Request

Posted on 2010-11-12
9
Medium Priority
?
614 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
Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

 
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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

752 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