Skip to content

Commit f035595

Browse files
fbourigaultNyholm
authored andcommitted
add Header authentication documentation (#270)
1 parent b36b869 commit f035595

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

message/authentication.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Authentication Methods
3333
|Matching | An authentication instance and a matcher callback | Behavior of the underlying authentication method if |
3434
| | | the matcher callback passes |
3535
+----------------+---------------------------------------------------+-----------------------------------------------------+
36+
|Header | Header name and value | Add an arbitrary authentication header |
37+
+----------------+---------------------------------------------------+-----------------------------------------------------+
3638

3739
.. _`Basic Auth`: https://en.wikipedia.org/wiki/Basic_access_authentication
3840
.. _WSSE: http://www.xml.com/pub/a/2003/12/17/dive.html
@@ -151,6 +153,17 @@ The first argument is an authentication method, the second is a regular expressi
151153
$authentication = Matching::createUrlMatcher(new AuthenticationMethod(), '\/api');
152154

153155

156+
Header
157+
******
158+
159+
With this authentication method you can add arbitrary headers.
160+
161+
In the following example, we are setting a ``X-AUTH-TOKEN`` header with it's value::
162+
163+
use Http\Message\Authentication\Header;
164+
165+
$authentication = new Header('X-AUTH-TOKEN', '9zh987g86fg87gh978hg9g79');
166+
154167
Implement Your Own
155168
^^^^^^^^^^^^^^^^^^
156169

0 commit comments

Comments
 (0)