[dev] How to make authentication with Horde_Http_Client?

Chuck Hagenbuch chuck at horde.org
Thu Oct 1 18:07:22 UTC 2009


Quoting Mathieu Parent <math.parent at gmail.com>:

> I'm currently implementing fetching of free/busy state from Microsoft
> Exchange servers using "Outlook Web Access" (see
> https://issues.kolab.org/issue3870).
>
> Most of Exchange servers provide free/busy without authentication, but
> sometime they request one. With the following schemes:
> WWW-Authenticate: Negotiate
> WWW-Authenticate: NTLM
> WWW-Authenticate: Basic realm="toto"
>
> What is the recommended way of handling authentication (Horde being an
> HTTP client )?

We now have support for at least basic:  
http://lists.horde.org/archives/commits/2009-October/002003.html

A simple example:

$client = new Horde_Http_Client();
$client->request->username = 'user';
$client->request->password = 'pass';

echo $client->get('url');


You can change the scheme to digest or NTLM if you have support for  
the curl or pecl_http adapters:
$client->request->authenticationScheme = Horde_Http::AUTH_DIGEST;

-chuck


More information about the dev mailing list