Digest
in package
Digest authentication adapter for Cake\Http\Client
Generally not directly constructed, but instead used by when $options['auth']['type'] is 'digest'
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor
- authentication() : Request
- Add Authorization header to the request.
- _generateHeader() : string
- Generate the header Authorization
- _getServerInfo() : array<string|int, mixed>
- Retrieve information about the authentication
Properties
$_client
Instance of Cake\Http\Client
protected
Client
$_client
Methods
__construct()
Constructor
public
__construct(Client $client[, array<string|int, mixed>|null $options = null ]) : mixed
Parameters
- $client : Client
-
Http client object.
- $options : array<string|int, mixed>|null = null
-
Options list.
authentication()
Add Authorization header to the request.
public
authentication(Request $request, array<string, mixed> $credentials) : Request
Parameters
- $request : Request
-
The request object.
- $credentials : array<string, mixed>
-
Authentication credentials.
Tags
Return values
Request —The updated request.
_generateHeader()
Generate the header Authorization
protected
_generateHeader(Request $request, array<string, mixed> $credentials) : string
Parameters
- $request : Request
-
The request object.
- $credentials : array<string, mixed>
-
Authentication credentials.
Return values
string_getServerInfo()
Retrieve information about the authentication
protected
_getServerInfo(Request $request, array<string|int, mixed> $credentials) : array<string|int, mixed>
Will get the realm and other tokens by performing another request without authentication to get authentication challenge.
Parameters
- $request : Request
-
The request object.
- $credentials : array<string|int, mixed>
-
Authentication credentials.
Return values
array<string|int, mixed> —modified credentials.