
21.02.2008, 22:49
|
|
Постоянный
Регистрация: 16.04.2007
Сообщений: 398
Провел на форуме: 3371897
Репутация:
1462
|
|
Upon receipt of an unauthorized request for a URI within the protection space, the server should respond with a challenge like the following:
WWW-Authenticate: Basic realm="WallyWorld"
where "WallyWorld" is the string assigned by the server to identify the protection space of the Request-URI.
To receive authorization, the client sends the user-ID and password, separated by a single colon (":") character, within a base64 [5] encoded string in the credentials.
basic-credentials = "Basic" SP basic-cookie
basic-cookie = <base64 [5] encoding of userid-password,
except not limited to 76 char/line>
userid-password = [ token ] ":" *TEXT
If the user agent wishes to send the user-ID "Aladdin" and password "open sesame", it would use the following header field:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
тоесть :
"GET /private/index.html HTTP/1.0
Host: localhost
Authorization: Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(username + ":" + Password))
а именно: строку в хидер:
Authorization: Basic ... + строку вида : Логин и Пароль через двоеточие - в Base64 ...
|
|
|