bogosoft/http-auth

A library for PSR-7 and PSR-15 compliant authentication middleware.

1.0.0 2020-11-29 17:20 UTC

This package is auto-updated.

Last update: 2024-12-29 06:46:22 UTC


README

A PHP library for PSR-7 and PSR-15 compliant authentication middleware.

Requirements

  • PHP >= 7.4

Package Dependencies

Installation

composer require bogosoft/http-auth

Summary

This small library contains a PSR-15 compliant authentication middleware component, AuthenticationMiddleware, with the following responsibilities:

  • Derive a security context (IPrincipal object) from a PSR-7 compliant HTTP request. The IPrincipal contract is from the bogosoft/identity package.
  • Pass the derived security context to a IPrincipalHandler object on a successful authentication attempt.
  • Immediately return an HTTP response with a 401 Unauthorized status code on a failed authentication attempt. this is configurable.

Interfaces

Implementations