PHP code example of juststeveking / http-auth-strategies

1. Go to this page and download the library: Download juststeveking/http-auth-strategies library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

juststeveking / http-auth-strategies example snippets


$strategy = new BasicStrategy(
    base64_encode("username:password")
);

// Get the Auth header as an array - passing through the 

$strategy = new NullStrategy();

// Get the Auth header as an array - passing through the 

$strategy = new CustomStrategy(
    'your-api-key'
);

$strategy->setHeaderName('X-API-KEY');

// Get the Auth header as an array - passing through the