petere
2008-02-10 16:40:04 UTC
Hi Paul,
I have had that problem many times before. There are a number of different ways a web page might require your login.
The 2 main methods are where the page will cause your browser to pop open a standard internet explorer password box or the page will have a custom form within its html.
If its an internet explorer style password box this is triggered as the first time you request the page the server actually returns a ?403-not authorised? error, this stimulates internet explorer to pop open the password box and when you click ok it re-requests the page with another line in the header:
"Authorization: Basic :user:password(base64)"
I guess if you always just sent that header on each request it will probably work.
If it?s a customised HTML form you will need to look at the html, look at the field names and whether the return method is GET of POST and return the data the same way.
With both of these types of web login its normal for them to return a cookie - which is just a string in the header, they will expect this to be sent back in the header on each subsequent page request so they still know who you are.
However you say your device just works after you have logged in using internet explorer so it sounds like its tracking your IP address rather than using cookies
I have found it easier in the past to use a command line call to wget rather than try to do it myself. ? this will work very well for you if it is just using your IP address
<a href="http://www.gnu.org/software/wget/" target="_blank">http://www.gnu.org/software/wget/</a>
You can easily call this using a system exec in labview.
You can also "cheat" - use wireshark to capture whatever internet explorer is sending and just send the same :-) - works 95% of the time as long as there is no challenge/ response type authentication.
<a href="http://www.wireshark.org/" target="_blank">http://www.wireshark.org/</a>
Hope this helps.
Peter
<a href="http://www.gnu.org/software/wget/" target="_blank">http://www.gnu.org/software/wget/</a>
you can also "cheat" - use wireshark to capture wahtever internet explorer is sending and just send the same :-) - works 95% of teh time as long as tehr eis no challenge responce type authentication.
Hope this helps.
Peter
I have had that problem many times before. There are a number of different ways a web page might require your login.
The 2 main methods are where the page will cause your browser to pop open a standard internet explorer password box or the page will have a custom form within its html.
If its an internet explorer style password box this is triggered as the first time you request the page the server actually returns a ?403-not authorised? error, this stimulates internet explorer to pop open the password box and when you click ok it re-requests the page with another line in the header:
"Authorization: Basic :user:password(base64)"
I guess if you always just sent that header on each request it will probably work.
If it?s a customised HTML form you will need to look at the html, look at the field names and whether the return method is GET of POST and return the data the same way.
With both of these types of web login its normal for them to return a cookie - which is just a string in the header, they will expect this to be sent back in the header on each subsequent page request so they still know who you are.
However you say your device just works after you have logged in using internet explorer so it sounds like its tracking your IP address rather than using cookies
I have found it easier in the past to use a command line call to wget rather than try to do it myself. ? this will work very well for you if it is just using your IP address
<a href="http://www.gnu.org/software/wget/" target="_blank">http://www.gnu.org/software/wget/</a>
You can easily call this using a system exec in labview.
You can also "cheat" - use wireshark to capture whatever internet explorer is sending and just send the same :-) - works 95% of the time as long as there is no challenge/ response type authentication.
<a href="http://www.wireshark.org/" target="_blank">http://www.wireshark.org/</a>
Hope this helps.
Peter
<a href="http://www.gnu.org/software/wget/" target="_blank">http://www.gnu.org/software/wget/</a>
you can also "cheat" - use wireshark to capture wahtever internet explorer is sending and just send the same :-) - works 95% of teh time as long as tehr eis no challenge responce type authentication.
Hope this helps.
Peter