You can use file_get_contents function to get content from some server. In some cases this function can be blocked because of security reasons or you need to download big file where usually file_get_contents crash. In this case you can use curl to download content.
Zend HTTP Client
Here we create new request with Zend Http Client to send username and password with POST to autenthicate user.