Altering log feedback

0.7.1-dev
SignpostMarv Martin 2011-03-24 16:46:21 +00:00 committed by Justin Clark-Casey (justincc)
parent e93531e124
commit 3f4be42a87
2 changed files with 17 additions and 14 deletions

View File

@ -57,10 +57,9 @@ namespace OpenSim.Services.AuthenticationService
public string Authenticate(UUID principalID, string password, int lifetime) public string Authenticate(UUID principalID, string password, int lifetime)
{ {
m_log.InfoFormat("[Authenticate]: Trying a web key authenticate");
if (new UUID(password) == UUID.Zero) if (new UUID(password) == UUID.Zero)
{ {
m_log.InfoFormat("[Authenticate]: NULL_KEY is not a valid web_login_key"); m_log.DebugFormat("[AUTH SERVICE]: UUID.Zero is not a valid web_login_key on PrincipalID {0}", principalID);
} }
else else
{ {
@ -69,17 +68,19 @@ namespace OpenSim.Services.AuthenticationService
{ {
if (data.Data.ContainsKey("webLoginKey")) if (data.Data.ContainsKey("webLoginKey"))
{ {
m_log.InfoFormat("[Authenticate]: Trying a web key authentication");
string key = data.Data["webLoginKey"].ToString(); string key = data.Data["webLoginKey"].ToString();
m_log.DebugFormat("[WEB LOGIN AUTH]: got {0} for key in db vs {1}", key, password); if (key == password)
if (key == password) {
{ data.Data["webLoginKey"] = UUID.Zero.ToString();
data.Data["webLoginKey"] = UUID.Zero.ToString(); m_Database.Store(data);
m_Database.Store(data); return GetToken(principalID, lifetime);
return GetToken(principalID, lifetime); }
} else
{
m_log.DebugFormat("[AUTH SERVICE]: web login auth failed, got PrincipalID {0} gave {1} instead of {2}", principalID, password, key);
}
}else{ }else{
m_log.DebugFormat("[Authenticate]: no col webLoginKey in passwd.db"); m_log.DebugFormat("[AUTH SERVICE]: no col webLoginKey in passwd.db");
} }
} }
m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID);

View File

@ -32,25 +32,27 @@ namespace OpenSim.Services.AuthenticationService
{ {
if (data.Data.ContainsKey("webLoginKey")) if (data.Data.ContainsKey("webLoginKey"))
{ {
m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID);
svc = ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Services.AuthenticationService.dll", "WebkeyAuthenticationService", args); svc = ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Services.AuthenticationService.dll", "WebkeyAuthenticationService", args);
result = svc.Authenticate(principalID, password, lifetime); result = svc.Authenticate(principalID, password, lifetime);
if (result == String.Empty) if (result == String.Empty)
{ {
m_log.DebugFormat("[Authenticate]: Web Login failed for PrincipalID {0}", principalID); m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID);
} }
} }
if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt"))
{ {
m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID);
svc = ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Services.AuthenticationService.dll", "PasswordAuthenticationService", args); svc = ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Services.AuthenticationService.dll", "PasswordAuthenticationService", args);
result = svc.Authenticate(principalID, password, lifetime); result = svc.Authenticate(principalID, password, lifetime);
if (result == String.Empty) if (result == String.Empty)
{ {
m_log.DebugFormat("[Authenticate]: Password login failed for PrincipalID {0}", principalID); m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID);
} }
} }
if (result == string.Empty) if (result == string.Empty)
{ {
m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based login failed for PrincipalID {0}", principalID); m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID);
} }
} }
else else