Permalink
Browse files

Add usage to HttpSocket::configAuth()

Fixes #2336
  • Loading branch information...
1 parent 71b41ed commit 1bc35831337f1071cc563fef66aaaee4ee22956b @markstory markstory committed Dec 4, 2011
Showing with 24 additions and 1 deletion.
  1. +24 −1 lib/Cake/Network/Http/HttpSocket.php
@@ -157,7 +157,30 @@ public function __construct($config = array()) {
}
/**
- * Set authentication settings
+ * Set authentication settings.
+ *
+ * Accepts two forms of parameters. If all you need is a username + password, as with
+ * Basic authentication you can do the following:
+ *
+ * {{{
+ * $http->configAuth('Basic', 'mark', 'secret');
+ * }}}
+ *
+ * If you are using an authentication strategy that requires more inputs, like Digest authentication
+ * you can call `configAuth()` with an array of user information.
+ *
+ * {{{
+ * $http->configAuth('Digest', array(
+ * 'user' => 'mark',
+ * 'pass' => 'secret',
+ * 'realm' => 'my-realm',
+ * 'nonce' => 1235
+ * ));
+ * }}}
+ *
+ * To remove any set authentication strategy, call `configAuth()` with no parameters:
+ *
+ * `$http->configAuth();`
*
* @param string $method Authentication method (ie. Basic, Digest). If empty, disable authentication
* @param mixed $user Username for authentication. Can be an array with settings to authentication class

0 comments on commit 1bc3583

Please sign in to comment.