AutoBasicAuth
in package
implements
Authentication
FinalYes
Authenticate a PSR-7 Request using Basic Auth based on credentials in the URI.
Tags
Table of Contents
Interfaces
- Authentication
- Add authentication information to a PSR-7 Request.
Properties
- $shouldRemoveUserInfo : bool
- Whether user info should be removed from the URI.
Methods
- __construct() : mixed
- authenticate() : RequestInterface
- Alter the request to add the authentication credentials.
Properties
$shouldRemoveUserInfo
Whether user info should be removed from the URI.
private
bool
$shouldRemoveUserInfo
Methods
__construct()
public
__construct([bool|true $shouldRremoveUserInfo = true ]) : mixed
Parameters
- $shouldRremoveUserInfo : bool|true = true
authenticate()
Alter the request to add the authentication credentials.
public
authenticate(RequestInterface $request) : RequestInterface
To do that, the implementation might use pre-stored credentials or do separate HTTP requests to obtain a valid token.
Parameters
- $request : RequestInterface
-
The request without authentication information
Return values
RequestInterface —The request with added authentication information