-
Notifications
You must be signed in to change notification settings - Fork 0
BasicCredential
Class BasicCredential.
Represents the parsed credential pair for HTTP Basic Authentication.
This credential consists of a username and password encoded as
Base64(username:password) in the Authorization header.
Implementations handling this class MUST treat the password as a sensitive secret. It MUST NOT be logged, exposed, or transmitted insecurely. The username MAY be considered non-sensitive depending on application rules, but the password MUST always be protected.
Instances of this class SHALL be returned by
- See: \FastForward\Http\Message\Header\Authorization\FastForward\Http\Message\Header\Authorization::parse() when the header contains a valid Basic Authentication value.
- Full name:
\FastForward\Http\Message\Header\Authorization\BasicCredential - This class is marked as final and can't be subclassed
- This class implements:
\FastForward\Http\Message\Header\Authorization\AuthorizationCredential - This class is a Final class
public string $usernamepublic string $passwordCreates a new Basic Authentication credential.
public __construct(string $username, string $password): mixedThe username and password MUST be extracted exactly as decoded from the
HTTP Authorization header. The password parameter is annotated with
#[\SensitiveParameter] to ensure that stack traces, debugging tools,
and error handlers do not accidentally reveal its value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$username |
string | the username provided by the client |
$password |
string | the plaintext password provided by the client |