Skip to content

Commit

Permalink
add Header authentication documentation (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbourigault authored and Nyholm committed Sep 16, 2019
1 parent b36b869 commit f035595
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions message/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Authentication Methods
|Matching | An authentication instance and a matcher callback | Behavior of the underlying authentication method if |
| | | the matcher callback passes |
+----------------+---------------------------------------------------+-----------------------------------------------------+
|Header | Header name and value | Add an arbitrary authentication header |
+----------------+---------------------------------------------------+-----------------------------------------------------+

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


Header
******

With this authentication method you can add arbitrary headers.

In the following example, we are setting a ``X-AUTH-TOKEN`` header with it's value::

use Http\Message\Authentication\Header;

$authentication = new Header('X-AUTH-TOKEN', '9zh987g86fg87gh978hg9g79');

Implement Your Own
^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit f035595

Please sign in to comment.