Hướng dẫn php base64 encode basic auth - php base64 mã hóa auth cơ bản

Tôi sử dụng Curl PHP để giao tiếp với API REST. Hầu hết các chức năng được thực hiện bằng cách sử dụng X-Ephemeral-Tokens, nhưng thật không may, chúng không cho phép xóa các quyền được đưa ra thông qua những điều này, vì vậy tôi phải thực hiện một chức năng để xóa thông qua xác thực cơ bản HTTP.

Rắc rối tôi gặp phải là mật khẩu cho tài khoản thử nghiệm là một chuỗi ngẫu nhiên, bao gồm nhiều ký tự đặc biệt (dấu ngoặc kép là một số trong số đó). Tôi đã nhận được yêu cầu làm việc bằng cách sử dụng nhị phân cong bình thường bằng cách xung quanh kết hợp username:password trong các trích dẫn đơn (tức là ') nhưng tôi không chắc chắn làm thế nào để chuyển đổi điều này thành PHP. Các đoạn trích có liên quan là dưới đây.

$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Accept: application/json",
                                              "Content-Type: application/json"));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $uname . ":" . $pass);
curl_setopt($curl, CURLOPT_URL, "https://cloud.ravellosystems.com/api/v1/applications/" . $appid);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
$result = curl_exec($curl);

Tôi đã thử các kết hợp khác nhau của các dấu ngoặc kép và mã hóa URL nhưng tôi vẫn nhận được mã phản hồi cho thấy xác thực không hoạt động đúng.

Đây là và yêu cầu exmaple HTTP dựa trên những gì tài liệu API hiển thị cho việc sử dụng Curl bình thường (được sửa đổi một chút)

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244

Bất kỳ đề xuất nào về làm thế nào để có được xung quanh điều này rất được đánh giá cao.

10 năm trướcheader() function to send an "Authentication Required" message to the client browser causing it to pop up a Username/Password input window. Once the user has filled in a username and a password, the URL containing the PHP script will be called again with the predefined variables PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE set to the user name, password and authentication type respectively. These predefined variables are found in the $_SERVER array. Only "Basic" and "Digest" authentication methods are supported. See the header() function for more information.

Marco Dot Moser tại Oltrefersina chấm nó ¶

16 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>

Ollie l ¶

12 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');

if (empty(

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>

najprogramato tại bài viết dot sk ¶: Compatibility Note

18 năm trước

Thay vì chỉ đơn giản là in ra PHP_AUTH_USER và PHP_AUTH_PW, như được thực hiện trong ví dụ trên, bạn có thể muốn kiểm tra tên người dùng và mật khẩu cho tính hợp lệ. Có lẽ bằng cách gửi một truy vấn đến cơ sở dữ liệu hoặc bằng cách tìm kiếm người dùng trong tệp DBM.

Xem ra cho trình duyệt trình duyệt internet explorer ngoài kia. Họ có vẻ rất kén chọn về thứ tự của các tiêu đề. Gửi tiêu đề xác thực www trước khi tiêu đề HTTP/1.0 401 dường như thực hiện thủ thuật cho bây giờ.

Lưu ý: LƯU Ý Cấu hình: Configuration Note

PHP sử dụng sự hiện diện của chỉ thị

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
0 để xác định xem xác thực bên ngoài có hiệu lực hay không.

Tuy nhiên, lưu ý rằng những điều trên không ngăn cản ai đó kiểm soát URL không xác nhận đánh cắp mật khẩu từ các URL được xác thực trên cùng một máy chủ.

Cả NetScape Navigator và Internet Explorer sẽ xóa bộ đệm xác thực của cửa sổ trình duyệt cục bộ cho vương quốc khi nhận được phản hồi máy chủ là 401. Điều này có thể "đăng xuất" một người dùng một cách hiệu quả, buộc họ phải nhập lại tên người dùng và mật khẩu của họ. Một số người sử dụng thông tin này để đăng nhập "hết thời gian" hoặc cung cấp nút "Đăng xuất".

Ví dụ #3 ví dụ xác thực HTTP buộc một tên/mật khẩu mới

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
1

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
2

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
3

Hành vi này không được yêu cầu bởi tiêu chuẩn xác thực

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
4, vì vậy bạn không bao giờ nên phụ thuộc vào điều này. Kiểm tra với
curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
5 đã chỉ ra rằng
curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
5 không xóa thông tin xác thực với phản hồi máy chủ 401, do đó nhấn lại và sau đó chuyển tiếp một lần nữa sẽ mở tài nguyên miễn là các yêu cầu thông tin xác thực không thay đổi. Tuy nhiên, người dùng có thể nhấn phím
curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
7 để xóa thông tin xác thực của họ.

Để xác thực HTTP hoạt động bằng máy chủ IIS với phiên bản CGI của PHP, bạn phải chỉnh sửa cấu hình IIS của mình "

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
8". Nhấp vào "
curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
9" và chỉ kiểm tra "username:password0", tất cả các trường khác phải được bỏ chọn.

Lưu ý: IIS Lưu ý: Để xác thực HTTP hoạt động với IIS, chỉ thị PHP CGI.RFC2616_Headers phải được đặt thành username:password1 (giá trị mặc định).: IIS Note:
For HTTP Authentication to work with IIS, the PHP directive cgi.rfc2616_headers must be set to username:password1 (the default value).

derkontrollfreak+9HY5L tại gmail dot com ¶

8 năm trước

username:password2

username:password3

username:password4

username:password5

kazakevichilya tại gmail dot com ¶

10 năm trước

username:password6

username:password7

username:password8

username:password9

'0

'1

'2

'3

'4

'5

'6

'7

'8

username:password5

quản trị trang web tại Kratia dot com ¶

15 năm trước

"Authentication Required"0

"Authentication Required"1

"Authentication Required"2

"Authentication Required"3

Yuriy ¶

13 năm trước

"Authentication Required"4

quản trị viên tại isprohosting dot com

15 năm trước

"Authentication Required"5

"Authentication Required"6

"Authentication Required"7

"Authentication Required"8

"Authentication Required"9

username:password5

Yuriy ¶

13 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
1

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
2

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
3

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
4

"Authentication Required"4

quản trị viên tại isprohosting dot com

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
5

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
6

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
7

Ẩn danh ¶

John_2232 tại Gmail Dot Com ¶

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
8

6 năm trước

Bitman tại Bitworks Dot de ¶

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
9

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
0

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

username:password5

1 năm trước

Ome ko ¶

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
3

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
4

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
5

username:password5

12 năm trước

8 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
7

kazakevichilya tại gmail dot com ¶

15 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
8

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
9

if (empty(0

if (empty(1

if (empty(2

username:password5

Yuriy ¶

10 năm trước

if (empty(4

if (empty(5

if (empty(6

if (empty(7

quản trị trang web tại Kratia dot com ¶

15 năm trước

if (empty(8

if (empty(9

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
0

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
1

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
2

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
3

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
4

username:password5

Yuriy ¶

13 năm trước

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
6

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
7

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
8

username:password5

"Authentication Required"4

13 năm trước

HTTP/1.0 4010

HTTP/1.0 4011

HTTP/1.0 4012

HTTP/1.0 4013

HTTP/1.0 4014

"Authentication Required"4

Bitman tại Bitworks Dot de ¶

HTTP/1.0 4015

HTTP/1.0 4016

HTTP/1.0 4017

HTTP/1.0 4018

username:password5

1 năm trước

Ome ko ¶

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
00

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
01

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
02

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
03

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
04

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
05

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
06

username:password5

12 năm trước

Ome ko ¶

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
08

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
09

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
10

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
11

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
12

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
13

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
14

username:password5

12 năm trước

10 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
16

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
17

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
18

username:password5

quản trị trang web tại Kratia dot com ¶

15 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
20

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
21

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
22

username:password5

Yuriy ¶

John_2232 tại Gmail Dot Com ¶

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
24

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
25

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
26

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
27

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
28

username:password5

6 năm trước

Ome ko ¶

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
30

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
31

username:password5

12 năm trước

15 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
33

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
34

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
35

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
36

username:password5

Yuriy ¶

13 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
38

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
39

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
40

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
41

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
42

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
43

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
44

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
45

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
46

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
47

username:password5

"Authentication Required"4

quản trị viên tại isprohosting dot com

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
49

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
50

username:password5

Ẩn danh ¶

John_2232 tại Gmail Dot Com ¶

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
52

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
53

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
54

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
55

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
56

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
57

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
4

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
59

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
60

6 năm trước

Bitman tại Bitworks Dot de ¶

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
61

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
62

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
63

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
64

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
65

1 năm trước

10 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
66

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
67

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
68

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
69

username:password5

Marco Dot Moser tại Oltrefersina chấm nó ¶

16 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
71

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
72

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
73

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
74

username:password5

Ollie l ¶

12 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
76

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
77

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
78

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
79

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
80

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
81

username:password5

najprogramato tại bài viết dot sk ¶

18 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
83

djreficul tại yahoo dot com ¶

16 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
84

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
85

username:password5

Ollie l ¶

12 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
87

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
88

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
89

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
90

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
91

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
92

username:password5

najprogramato tại bài viết dot sk ¶

18 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
94

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
95

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
96

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
97

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
98

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
99

username:password00

username:password01

username:password02

username:password5

djreficul tại yahoo dot com ¶

16 năm trước

username:password04

Ollie l ¶

18 năm trước

username:password05

djreficul tại yahoo dot com ¶

18 năm trước

username:password06

username:password07

username:password08

username:password09

username:password10

username:password5

djreficul tại yahoo dot com ¶

snagnever tại gmail dot com

username:password12

username:password13

username:password14

17 năm trước

16 năm trước

username:password15

username:password16

username:password17

username:password18

username:password19

username:password20

username:password21

username:password22

username:password5

Jason ¶

12 năm trước

username:password24

username:password25

"Authentication Required"1

username:password27

username:password28

najprogramato tại bài viết dot sk ¶

12 năm trước

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
00

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
01

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
02

username:password32

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
04

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
05

curl -v -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user :password https://cloud.ravellosystems.com/api/v1/applications/414244
06

username:password36

username:password5

najprogramato tại bài viết dot sk ¶

18 năm trước

username:password38

username:password39

username:password5

djreficul tại yahoo dot com ¶

18 năm trước

username:password41

username:password42

username:password43

username:password44

username:password45

username:password5

djreficul tại yahoo dot com ¶

snagnever tại gmail dot com

username:password47

username:password48

username:password49

username:password50

username:password51

username:password52

17 năm trước

Làm thế nào để gửi Auth PHP cơ bản?

Để gửi thông tin xác thực cơ bản với Curl, hãy sử dụng tùy chọn "-u đăng nhập: mật khẩu". Curl tự động chuyển đổi đăng nhập: cặp mật khẩu thành chuỗi được mã hóa cơ sở64 và thêm tiêu đề "ủy quyền: cơ bản [mã thông báo]" vào yêu cầu.use the "-u login: password" command-line option. Curl automatically converts the login: password pair into a Base64-encoded string and adds the "Authorization: Basic [token]" header to the request.

Basic Auth được mã hóa như thế nào?

Chúng chỉ được mã hóa với Base64 trong quá cảnh và không được mã hóa hoặc băm theo bất kỳ cách nào. Do đó, xác thực cơ bản thường được sử dụng cùng với HTTPS để cung cấp bảo mật.with Base64 in transit and not encrypted or hashed in any way. Therefore, basic authentication is typically used in conjunction with HTTPS to provide confidentiality.

Máy chủ $ _ là gì ['PHP_AUTH_USER'] là gì?

Khi người dùng đã điền tên người dùng và mật khẩu, URL chứa tập lệnh PHP sẽ được gọi lại với các biến được xác định trước PHP_AUTH_USER, PHP_AUTH_PW và AUTH_TYPE được đặt thành tên người dùng, mật khẩu và loại xác thực.Các biến được xác định trước này được tìm thấy trong mảng $ _Server.predefined variables are found in the $_SERVER array.

Tên người dùng và mật khẩu được lưu trữ trong chương trình PHP khi sử dụng xác thực HTTP ở đâu?

Khi thực hiện xác thực HTTP/HTTPS cơ bản, PHP sử dụng ba tên biến được xác định trước trong mảng $ _Server.Xác thực http/https cơ bản đặt ID người dùng và mật khẩu trong $ _server ['PHP_AUTH_USER'] và $ _Server ['PHP_AUTH_PW'].$_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] respectively.