Custom authentication handlers are designed to be extremely simple to write.
In order to write a handler, you’ll need to implement the
An instance of this handler is then passed in by the user via the
option, just like for normal authentication.
Let’s say we have a HTTP endpoint that checks for the
Hotdog header and
authenticates you if said header is set to
Yummy. (I don’t know of any
services that do this; perhaps this is a market waiting to be tapped?)
We then use this in our request calls:
$options = array( 'auth' => new MySoftware_Auth_Hotdog('yummy') ); $response = Requests::get('http://hotdogbin.org/admin', array(), $options);
(For more information on how to register and use hooks, see the hooking system documentation)