Download the PHP package pflorek/php-basic-auth without Composer
On this page you can find all versions of the php package pflorek/php-basic-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pflorek/php-basic-auth
More information about pflorek/php-basic-auth
Files in pflorek/php-basic-auth
Package php-basic-auth
Short Description Provides a simple way to get or set credentials (username, password) on a PSR-7 `RequestInterface`. Also it helps challenging an unauthorized client by adding the 'WWW-authenticate' header line with status code 401 to a PSR-7 `ResponseInterface`.
License MIT
Informations about the package php-basic-auth
PHP Basic Auth
This library provides a simple way to get or set credentials (username, password) on a PSR-7 RequestInterface
. Also it helps challenging an unauthorized client by adding the 'WWW-authenticate' header line with status code 401 to a PSR-7 ResponseInterface
. It should be helpful if a PSR-15 Middleware
is not applicable.
- There is no validation if username is correct (should not contain
:
). - Also there is no validation if basic credentials are properly base64 encoded.
- Omitted
Authorization
header line or missing basic credentials will returnnull
credentials. - Can only challenge for
Basic Auth
.Digest
is currently not supported. - For backward compatibility for PHP >= 5.4 PSR-17 HTTP factories currently not supported.
- Should comply with RFC 7617.
Usage
Obtain credentials
Obtain credentials (username, password) from PSR-7 request interface.
Add credentials
Add credentials (username, password) to PSR-7 request interface for basic authentication.
Add challenge
Add challenge with realm to PSR-7 response interface for basic authentication.
Installation
Use Composer to install the package:
Authors
Contribute
Contributions are always welcome!
- Report any bugs or issues on the issue tracker.
- You can download the sources at the package's Git repository.
License
All contents of this package are licensed under the MIT license.