Skip to content

codazoda/http-basic-auth-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Basic Authentication in PHP

A template that does basic authentication in PHP and has no outside dependencies.

WARNING: It is insecure to use HTTP Basic Authentication without HTTPS (TLS) encryption.

Usage

This is a light weight class that's easy to use.

require "BasicAuth.php";

// Instantiate an instance of the authentication class
$basic = new BasicAuth('../users.ini');

// Authorize every request or bail
if (!$basic->auth()) {
    die();
}

Testing

Clone this repo and run the PHP server to test it.

php -S localhost:8004

About

A template that does basic authentication in PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages