if (header == null || header.Length < 2)
return;
- string [] authenticationData = header.Substring (header.IndexOf (":")+1).Split (new char [] {' '});
+ string [] authenticationData = header.Substring (header.IndexOf (':') + 1).Split (new char [] {' '});
if (string.Compare (authenticationData [0], "basic", true) == 0) {
user = ParseBasicAuthentication (authenticationData [1]);
internal IPrincipal ParseBasicAuthentication (string authData) {
try {
// Basic AUTH Data is a formatted Base64 String
- string domain = null;
+ //string domain = null;
string user = null;
string password = null;
int pos = -1;
// The format is DOMAIN\username:password
// Domain is optional
- pos = authString.IndexOf (":");
+ pos = authString.IndexOf (':');
// parse the password off the end
password = authString.Substring (pos+1);
authString = authString.Substring (0, pos);
// check if there is a domain
- pos = authString.IndexOf ("\\");
+ pos = authString.IndexOf ('\\');
if (pos > 0) {
- domain = authString.Substring (0, pos);
+ //domain = authString.Substring (0, pos);
user = authString.Substring (pos);
} else {
user = authString;