Web Basic Authentication

  • Thread starter Thread starter Stanley
  • Start date Start date
S

Stanley

Hi all! When I go to some web site, I have to provide username and
password, like my router's web site. The question is the how can I
programmatically capture the 'realm' (Like 'level_15_access'), and
provide username and password in vb.net? Thanks!
 
Stanley said:
Hi all! When I go to some web site, I have to provide username and
password, like my router's web site. The question is the how can I
programmatically capture the 'realm' (Like 'level_15_access'), and
provide username and password in vb.net? Thanks!

Do you want to implement the authentication mechanism?
Do you have the site's source code?
Where do you want to capture the realm?
 
all logins receive there data either by a get or a post ( provided in the
url , provided in the header )

if you know the username and password , or other values the page is
expecting you only have to find out wich way they use ( can be seen in the
HTML , or script source that is on your browser side )
then create a url http://www.asite.com/pass.aspx?uname=john&pass=doe& or
if the site requires a post create the values in a form posting and submit
this to the website ( this can be done in HTML or directly from code )

regrds

M. Posseth
 
I know that can I go to the web site by this kind of url
http://user:[email protected] because the authentication is "Basic Web
Authenticaion", but the problem is that I want to get the 'realm' or
'message' of the site before I determine which user and pass to give,
because I want to go to different kind of router (Linksys, D-Link ....)
Hope you can understand my English! Thanks!
 
Stanley said:
I know that can I go to the web site by this kind of url
http://user:[email protected]

Just FYI: This is an invalid HTTP URL.
because the authentication is "Basic Web
Authenticaion", but the problem is that I want to get the 'realm' or
'message' of the site

Are you referring to the short message typically shown in the login dialog?
 
Thanks for reply! Yes, that's what I'm saying! The short message like
"level_15_access" for Cisco Router, "Linksys BEFSR81v3" for Linksys
Router else... Can you tell me how to capture that short message, so
that I can identify which router it is!! Thanks again!
 
Hi Stanley
This thread is a couple of months old, but anyway i hope to be helpful.
This is something I am currently doing too.
It's very simple. In VB6, you need to use a Microsoft Internet Transfer
Control, set some properties like the URL and then call the GetHeader
method and that's it. The rest is just string manipulation.

header = Inet1.GetHeader

The variable header shoud now have a value such as:

HTTP/1.1 401 Authorization Required
WWW-Authenticate: Basic realm="Linksys BEFW11S4 V4"
Content-type: text/html
Expires: Thu, 13 Dec 1969 10:29:00 GMT
Connection: close
Pragma: no-cache

good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top