From 9a781e793a649c75d0054dee8271fc611318dd25 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 20 Mar 2010 19:21:58 -0700 Subject: * Updated libomv libraries to fix JSON (LLSD) decoding errors on null values and remove the unused OpenMetaverse.Http.dll and Mono.Security.dll * Fixed a password hash comparison error in SimianAuthenticationServiceConnector.Authenticate() --- .../Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index cc53d6c..29c9219 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -114,7 +114,7 @@ namespace OpenSim.Services.Connectors.SimianGrid { string credential = identity["Credential"].AsString(); - if (password == credential || Utils.MD5String(password) == credential) + if (password == credential || "$1$" + Utils.MD5String(password) == credential) return Authorize(principalID); } } -- cgit v1.1 From 5a2315c68c7ccac2fafeb7e2cd51ecda863a9fa7 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 26 Mar 2010 12:21:05 -0700 Subject: * Fixed a bug with null value handling in WebUtil.BuildQueryString() * Changed the null check back in estate manager setup but fixed the case for an existing account being found * Implemented SetPassword() in the SimianGrid auth connector --- .../SimianAuthenticationServiceConnector.cs | 43 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 29c9219..031b326 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -177,9 +177,46 @@ namespace OpenSim.Services.Connectors.SimianGrid public bool SetPassword(UUID principalID, string passwd) { - // TODO: Use GetIdentities to find the md5hash identity for principalID - // and then update it with AddIdentity - m_log.Error("[AUTH CONNECTOR]: Changing passwords is not implemented yet"); + // Fetch the user name first + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "GetUser" }, + { "UserID", principalID.ToString() } + }; + + OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); + if (response["Success"].AsBoolean() && response["User"] is OSDMap) + { + OSDMap userMap = (OSDMap)response["User"]; + string identifier = userMap["Name"].AsString(); + + if (!String.IsNullOrEmpty(identifier)) + { + // Add/update the md5hash identity + requestArgs = new NameValueCollection + { + { "RequestMethod", "AddIdentity" }, + { "Identifier", identifier }, + { "Credential", "$1$" + Utils.MD5String(passwd) }, + { "Type", "md5hash" }, + { "UserID", principalID.ToString() } + }; + + response = WebUtil.PostToService(m_serverUrl, requestArgs); + bool success = response["Success"].AsBoolean(); + + if (!success) + m_log.WarnFormat("[AUTH CONNECTOR]: Failed to set password for {0} ({1})", identifier, principalID); + + return success; + } + } + else + { + m_log.Warn("[AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " + + response["Message"].AsString()); + } + return false; } -- cgit v1.1 From 1430441cf32c659502c6ed1bd7fd54e55a107c05 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 26 Mar 2010 15:13:55 -0700 Subject: Change the SimianGrid connector log messages to start with "[SIMIAN " to avoid configuration confusion --- .../SimianGrid/SimianAuthenticationServiceConnector.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 031b326..e78429d 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -78,14 +78,14 @@ namespace OpenSim.Services.Connectors.SimianGrid IConfig assetConfig = source.Configs["AuthenticationService"]; if (assetConfig == null) { - m_log.Error("[AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); + m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); throw new Exception("Authentication connector init error"); } string serviceURI = assetConfig.GetString("AuthenticationServerURI"); if (String.IsNullOrEmpty(serviceURI)) { - m_log.Error("[AUTH CONNECTOR]: No Server URI named in section AuthenticationService"); + m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService"); throw new Exception("Authentication connector init error"); } @@ -120,11 +120,11 @@ namespace OpenSim.Services.Connectors.SimianGrid } } - m_log.Warn("[AUTH CONNECTOR]: Authentication failed for " + principalID); + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID); } else { - m_log.Warn("[AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " + + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " + response["Message"].AsString()); } @@ -146,7 +146,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } else { - m_log.Warn("[AUTH CONNECTOR]: Could not verify session for " + principalID + ": " + + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Could not verify session for " + principalID + ": " + response["Message"].AsString()); } @@ -168,7 +168,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } else { - m_log.Warn("[AUTH CONNECTOR]: Failed to remove session for " + principalID + ": " + + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Failed to remove session for " + principalID + ": " + response["Message"].AsString()); } @@ -206,14 +206,14 @@ namespace OpenSim.Services.Connectors.SimianGrid bool success = response["Success"].AsBoolean(); if (!success) - m_log.WarnFormat("[AUTH CONNECTOR]: Failed to set password for {0} ({1})", identifier, principalID); + m_log.WarnFormat("[SIMIAN AUTH CONNECTOR]: Failed to set password for {0} ({1})", identifier, principalID); return success; } } else { - m_log.Warn("[AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " + + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " + response["Message"].AsString()); } -- cgit v1.1