Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from lippoliv/lippoliv-patch-1
Browse files Browse the repository at this point in the history
Closes WP-API#25
  • Loading branch information
lippoliv committed Oct 18, 2015
2 parents d20ac18 + 87fe9d9 commit 3e3412d
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 3e3412d

Please sign in to comment.