Add a real_id field to the login response if impersonation is used. The wrapper

script needs this for proper logging.
This commit is contained in:
Melanie
2012-08-15 23:31:38 +02:00
parent 8cd4042f9e
commit c313de630f
9 changed files with 64 additions and 6 deletions

View File

@@ -54,6 +54,13 @@ namespace OpenSim.Services.AuthenticationService
}
public string Authenticate(UUID principalID, string password, int lifetime)
{
UUID realID;
return Authenticate(principalID, password, lifetime, out realID);
}
public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)
{
AuthenticationData data = m_Database.Get(principalID);
string result = String.Empty;
@@ -62,7 +69,7 @@ namespace OpenSim.Services.AuthenticationService
if (data.Data.ContainsKey("webLoginKey"))
{
m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID);
result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime);
result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime, out realID);
if (result == String.Empty)
{
m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID);
@@ -71,12 +78,15 @@ namespace OpenSim.Services.AuthenticationService
if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt"))
{
m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID);
result = m_svcChecks["password"].Authenticate(principalID, password, lifetime);
result = m_svcChecks["password"].Authenticate(principalID, password, lifetime, out realID);
if (result == String.Empty)
{
m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID);
}
}
realID = UUID.Zero;
if (result == string.Empty)
{
m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID);
@@ -89,4 +99,4 @@ namespace OpenSim.Services.AuthenticationService
return result;
}
}
}
}