Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update basic-auth.php
Closes #25
  • Loading branch information
lippoliv committed Oct 18, 2015
commit 87fe9d9e649bc6bd871a010d303b5f42bcf8a848
5 changes: 5 additions & 0 deletions basic-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ function json_basic_auth_handler( $user ) {
if ( ! empty( $user ) ) {
return $user;
}

// Support PHP FastCGI Redirect
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' , base64_decode(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 6)));
}

// Check that we're trying to authenticate
if ( !isset( $_SERVER['PHP_AUTH_USER'] ) ) {
Expand Down