Forum Moderators: coopster

Message Too Old, No Replies

How to bypass authenticated feeds

got a url with user name and password

         

flexi

2:59 pm on Nov 12, 2008 (gmt 0)

10+ Year Member



I have got a url http://www.example.com/filename when I give this url on the browser a authentication box appears were i have to give the user name and password, this will open an xml feed.
Now I want to by pass the authentication by using header function to get the xml feed directly by running a php script.
Without using curl option

[edited by: dreamcatcher at 6:35 pm (utc) on Nov. 12, 2008]
[edit reason] use example.com. Thanks. [/edit]

PHP_Chimp

8:34 am on Nov 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you control that url then why dont you just put it in a non-password protected area? As if you are allowing anyone to access the data then it isnt work password protecting...

You may be able to use http(s)://username:password@server/resource.ext

flexi

9:21 am on Nov 13, 2008 (gmt 0)

10+ Year Member



Hi Chimp
I may have not explained it properly

I have been given this url by a feed provider.It is a asp code (http://www.example.com/filename.asp) which when executed results in a xml feed.

Now through my php code I want to capture the xml data into a variable (since i don't know if the results are displayed in the xml file)

if it is a xml file I could read the file using [user:pass@example.com...] using file_get_contents or fopen command.but I have been provided with the link (asp code) which displays the xml data

coopster

4:02 pm on Nov 15, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You just need to automate your communication session with the feed, whether it be a direct link that returns data or if it is a session that is authenticating first, etc. You open a socket and "talk" with the other server. You send the request and you read the response in your processing script.

I know you said you don't want to use the curl option, but, unless I am misunderstanding you, without opening a socket for communication your task will prove quite difficult, in not impossible.

vincevincevince

4:17 am on Nov 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cURL is almost certainly your best option; despite your reservations. If you don't like that idea, try asking the site administrator to allow you access via standard HTTP authentication.

flexi

5:16 am on Nov 17, 2008 (gmt 0)

10+ Year Member



thanks guys for ur help
finally had to use curl itself..could not find any other way