Basic
in package
Basic authentication adapter for Cake\Http\Client
Generally not directly constructed, but instead used by when $options['auth']['type'] is 'basic'
Table of Contents
Methods
- authentication() : Request
- Add Authorization header to the request.
- proxyAuthentication() : Request
- Proxy Authentication
- _generateHeader() : string
- Generate basic [proxy] authentication header
Methods
authentication()
Add Authorization header to the request.
public
authentication(Request $request, array<string|int, mixed> $credentials) : Request
Parameters
- $request : Request
-
Request instance.
- $credentials : array<string|int, mixed>
-
Credentials.
Tags
Return values
Request —The updated request.
proxyAuthentication()
Proxy Authentication
public
proxyAuthentication(Request $request, array<string|int, mixed> $credentials) : Request
Parameters
- $request : Request
-
Request instance.
- $credentials : array<string|int, mixed>
-
Credentials.
Tags
Return values
Request —The updated request.
_generateHeader()
Generate basic [proxy] authentication header
protected
_generateHeader(string $user, string $pass) : string
Parameters
- $user : string
-
Username.
- $pass : string
-
Password.