From b1084e612fdba62e87f17d5bad2639532b38fb2b Mon Sep 17 00:00:00 2001 From: Fabien Bourigault Date: Mon, 16 Sep 2019 16:25:52 +0200 Subject: [PATCH] add Header authentication documentation --- message/authentication.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/message/authentication.rst b/message/authentication.rst index 57d815a..2ced78e 100644 --- a/message/authentication.rst +++ b/message/authentication.rst @@ -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 @@ -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 ^^^^^^^^^^^^^^^^^^