From 7870152d23db4cb6f5834d4921fac17feb717220 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Sep 2009 14:54:12 +0100 Subject: Allow load/save iar password checks to be done in grid mode This should allow load/save iar to work for grid mode as long as the grid user service is later than this revision Grid services of earlier revisions will always erroneously report incorrect password. This will be addressed shortly. --- OpenSim/Grid/UserServer.Modules/UserManager.cs | 56 +++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'OpenSim/Grid/UserServer.Modules/UserManager.cs') diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs index 002f232..bc19ac8 100644 --- a/OpenSim/Grid/UserServer.Modules/UserManager.cs +++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs @@ -108,6 +108,9 @@ namespace OpenSim.Grid.UserServer.Modules m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID); m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar); + // Used by IAR module to do password checks + //m_httpServer.AddXmlRPCHandler("authenticate_user_by_password", XmlRPCAuthenticateUserMethodPassword); + m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion); m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID); m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID); @@ -203,6 +206,57 @@ namespace OpenSim.Grid.UserServer.Modules #region XMLRPC User Methods + /// + /// Authenticate a user using their password + /// + /// Must contain values for "user_uuid" and "password" keys + /// + /// + public XmlRpcResponse XmlRPCAuthenticateUserMethodPassword(XmlRpcRequest request, IPEndPoint remoteClient) + { +// m_log.DebugFormat("[USER MANAGER]: Received authenticated user by password request from {0}", remoteClient); + + Hashtable requestData = (Hashtable)request.Params[0]; + string userUuidRaw = (string)requestData["user_uuid"]; + string password = (string)requestData["password"]; + + if (null == userUuidRaw) + return Util.CreateUnknownUserErrorResponse(); + + UUID userUuid; + if (!UUID.TryParse(userUuidRaw, out userUuid)) + return Util.CreateUnknownUserErrorResponse(); + + UserProfileData userProfile = m_userDataBaseService.GetUserProfile(userUuid); + if (null == userProfile) + return Util.CreateUnknownUserErrorResponse(); + + string authed; + + if (null == password) + { + authed = "FALSE"; + } + else + { + if (m_userDataBaseService.AuthenticateUserByPassword(userUuid, password)) + authed = "TRUE"; + else + authed = "FALSE"; + } + +// m_log.DebugFormat( +// "[USER MANAGER]: Authentication by password result from {0} for {1} is {2}", +// remoteClient, userUuid, authed); + + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); + responseData["auth_user"] = authed; + response.Value = responseData; + + return response; + } + public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient) { // XmlRpcResponse response = new XmlRpcResponse(); @@ -246,10 +300,10 @@ namespace OpenSim.Grid.UserServer.Modules m_userDataBaseService.CommitAgent(ref userProfile); //setUserProfile(userProfile); - returnstring = "TRUE"; } } + responseData.Add("returnString", returnstring); response.Value = responseData; return response; -- cgit v1.1 From e1abc3d4c49ae4068faf7b8d1dcb220829429757 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Sep 2009 15:22:47 +0100 Subject: re-enable registration of user service authentication method I accidentally disabled a few commits ago load/save iar on a grid should now work, provided that the user service is this revision or newer --- OpenSim/Grid/UserServer.Modules/UserManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Grid/UserServer.Modules/UserManager.cs') diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs index bc19ac8..efbf45e 100644 --- a/OpenSim/Grid/UserServer.Modules/UserManager.cs +++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs @@ -109,7 +109,7 @@ namespace OpenSim.Grid.UserServer.Modules m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar); // Used by IAR module to do password checks - //m_httpServer.AddXmlRPCHandler("authenticate_user_by_password", XmlRPCAuthenticateUserMethodPassword); + m_httpServer.AddXmlRPCHandler("authenticate_user_by_password", XmlRPCAuthenticateUserMethodPassword); m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion); m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID); -- cgit v1.1 From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 01:00:09 +0900 Subject: Formatting cleanup. --- OpenSim/Grid/UserServer.Modules/UserManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Grid/UserServer.Modules/UserManager.cs') diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs index efbf45e..36c6297 100644 --- a/OpenSim/Grid/UserServer.Modules/UserManager.cs +++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs @@ -229,7 +229,7 @@ namespace OpenSim.Grid.UserServer.Modules UserProfileData userProfile = m_userDataBaseService.GetUserProfile(userUuid); if (null == userProfile) - return Util.CreateUnknownUserErrorResponse(); + return Util.CreateUnknownUserErrorResponse(); string authed; @@ -249,12 +249,12 @@ namespace OpenSim.Grid.UserServer.Modules // "[USER MANAGER]: Authentication by password result from {0} for {1} is {2}", // remoteClient, userUuid, authed); - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable responseData = new Hashtable(); + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); responseData["auth_user"] = authed; response.Value = responseData; - return response; + return response; } public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient) -- cgit v1.1