Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello All,
 
I'm making a web browser with the default browser control of visual studio 2012.
 
but i want to make a custom login popup when a website is trying to login
with a .htpasswd file(this usually happens if you try to access you're router website or such sites)
 
my problem is: I don't know the request the website is sending toe the web browser(if it IS a request!!!)
 
Please help me,,
 
Bart de Lange
Posted 24-Apr-13 9:05am
Comments
Sergey Alexandrovich Kryukov at 24-Apr-13 14:35pm
   
Not clear. How .htpasswd (Apache?) is related to WebBrowser and System.Windows.Forms?!
—SA
Bart de Lange at 24-Apr-13 15:40pm
   
Yes apache
 
I made a few websites in the past an a couple of them used the htpasswd file
So i thougt it is website based
 
But if you visit such a site with the new win 8 style ie than you get a different popup then if you visit it with chrome or firefox
So because of that i know that it is not. Website based but a browser based popup
And i want to know how to handle that because a want to customize it(thats why i also dont have a code)
Sergey Alexandrovich Kryukov at 24-Apr-13 15:47pm
   
Still unclear, even more unclear. You are talking about client side now. How it all depends on what's on client? Unrelated things...
—SA
Bart de Lange at 24-Apr-13 15:52pm
   
Yes the popup is cleint side but the htpassws file is server side.
the server(apache or whatever) is sending something(i want to know what and how??) to the browser that makes the browser opens up a popu screen with a username and a password field and then the browser sends the info back to the server and he chrcks if it is correct
Sergey Alexandrovich Kryukov at 24-Apr-13 16:01pm
   
All the server-side internals, like this file, are totally hidden from the client side. An HTTP server sends anything only on HTTP request. You can try sending HTTP request using VB.NET application (not browser) directly to server and see what's in the HTTP response.
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please see my last comment to the question, about HTTP response and HTTP request. You can do it directly using the class System.Net.HttpWebRequest:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].
 
It might help you to understand what's going on, but I doubt it immediately help you to solve your problem. I suspect that your problem is based on misunderstanding of how Web words, so you cannot even explain the problem. Learn about it some more; this is the best way to help yourself.
 
—SA
  Permalink  
Comments
Bart de Lange at 9-Jun-13 5:48am
   
OK i gave it another try to look what the .htpasswd file does
 
and here it is
 
it sends a login request to the browser and normally the browser then shows the user a login pop up(like when you trying to login on your routers web page where you can define your routers settings) this pop up is made by the browser itself because it is a different pop up if you are using IE or Google Chrome.
 
so when you're trying to access a site which is blocked by a .htpasswd file Apache sends a login request and the browser then responds with a pop up to let the user login to the site
 
Kind Regards,
Bart de Lange
 

P.S. Sorry to bumb this question but i really need to know this because its the only thing that my browser is not capable of
(and downloading files from example download.aspx?file=.... or download.php?file=....)
Bart de Lange at 9-Jun-13 7:11am
   
OK i know a little more it has to do something with the web credentials and the basic authentication/basic realm
 
and intercepting a 401 HTTP status code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 155
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411028.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100