PHPackages                             dflydev/stack-basic-authentication - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. dflydev/stack-basic-authentication

ActiveLibrary[HTTP &amp; Networking](/categories/http)

dflydev/stack-basic-authentication
==================================

HTTP Basic Authentication Stack middleware

123.8k3[1 issues](https://github.com/dflydev/dflydev-stack-basic-authentication/issues)[1 PRs](https://github.com/dflydev/dflydev-stack-basic-authentication/pulls)PHP

Since Dec 8Pushed 8y ago2 watchersCompare

[ Source](https://github.com/dflydev/dflydev-stack-basic-authentication)[ Packagist](https://packagist.org/packages/dflydev/stack-basic-authentication)[ RSS](/packages/dflydev-stack-basic-authentication/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

HTTP Basic Authentication Stack Middleware
==========================================

[](#http-basic-authentication-stack-middleware)

A [Stack](http://stackphp.com/) middleware to enable [HTTP Basic Authentication](http://en.wikipedia.org/wiki/Basic_access_authentication) following the [STACK-2 Authentication](http://stackphp.com/specs/STACK-2/) conventions.

Installation
------------

[](#installation)

Through [Composer](http://getcomposer.org) as [dflydev/stack-basic-authentication](https://packagist.org/packages/dflydev/stack-basic-authentication).

Usage
-----

[](#usage)

The BasicAuthentication middleware accepts the following options:

- **authenticator**: *(required)* A callback used to ensure that the specified credentials are correct.
- **realm**: The HTTP Basic Authentication realm as defined by [RFC1945](http://tools.ietf.org/html/rfc1945#section-11).
- **firewall**: A firewall configuration compatible with [dflydev/stack-firewall](https://packagist.org/packages/dflydev/stack-firewall).

```
