diff options
9 files changed, 64 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs index 9484a5a..25ee4c6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs | |||
@@ -137,6 +137,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | |||
137 | 137 | ||
138 | #region IAuthenticationService | 138 | #region IAuthenticationService |
139 | 139 | ||
140 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
141 | { | ||
142 | // Not implemented at the regions | ||
143 | return string.Empty; | ||
144 | } | ||
145 | |||
140 | public string Authenticate(UUID principalID, string password, int lifetime) | 146 | public string Authenticate(UUID principalID, string password, int lifetime) |
141 | { | 147 | { |
142 | // Not implemented at the regions | 148 | // Not implemented at the regions |
diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 769c3c2..9d12d47 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs | |||
@@ -64,6 +64,15 @@ namespace OpenSim.Services.AuthenticationService | |||
64 | 64 | ||
65 | public string Authenticate(UUID principalID, string password, int lifetime) | 65 | public string Authenticate(UUID principalID, string password, int lifetime) |
66 | { | 66 | { |
67 | UUID realID; | ||
68 | |||
69 | return Authenticate(principalID, password, lifetime, out realID); | ||
70 | } | ||
71 | |||
72 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
73 | { | ||
74 | realID = UUID.Zero; | ||
75 | |||
67 | m_log.DebugFormat("[AUTH SERVICE]: Authenticating for {0}, user account service present: {1}", principalID, m_UserAccountService != null); | 76 | m_log.DebugFormat("[AUTH SERVICE]: Authenticating for {0}, user account service present: {1}", principalID, m_UserAccountService != null); |
68 | AuthenticationData data = m_Database.Get(principalID); | 77 | AuthenticationData data = m_Database.Get(principalID); |
69 | UserAccount user = null; | 78 | UserAccount user = null; |
@@ -127,6 +136,7 @@ namespace OpenSim.Services.AuthenticationService | |||
127 | if (data.Data["passwordHash"].ToString() == hashed) | 136 | if (data.Data["passwordHash"].ToString() == hashed) |
128 | { | 137 | { |
129 | m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); | 138 | m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); |
139 | realID = a.PrincipalID; | ||
130 | return GetToken(principalID, lifetime); | 140 | return GetToken(principalID, lifetime); |
131 | } | 141 | } |
132 | // else | 142 | // else |
diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs index d02ff9b..47b4fa6 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs | |||
@@ -60,6 +60,13 @@ namespace OpenSim.Services.AuthenticationService | |||
60 | { | 60 | { |
61 | } | 61 | } |
62 | 62 | ||
63 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
64 | { | ||
65 | realID = UUID.Zero; | ||
66 | |||
67 | return Authenticate(principalID, password, lifetime); | ||
68 | } | ||
69 | |||
63 | public string Authenticate(UUID principalID, string password, int lifetime) | 70 | public string Authenticate(UUID principalID, string password, int lifetime) |
64 | { | 71 | { |
65 | if (new UUID(password) == UUID.Zero) | 72 | if (new UUID(password) == UUID.Zero) |
diff --git a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs index 2c6cebd..7fbf36d 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs | |||
@@ -55,6 +55,13 @@ namespace OpenSim.Services.AuthenticationService | |||
55 | 55 | ||
56 | public string Authenticate(UUID principalID, string password, int lifetime) | 56 | public string Authenticate(UUID principalID, string password, int lifetime) |
57 | { | 57 | { |
58 | UUID realID; | ||
59 | |||
60 | return Authenticate(principalID, password, lifetime, out realID); | ||
61 | } | ||
62 | |||
63 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
64 | { | ||
58 | AuthenticationData data = m_Database.Get(principalID); | 65 | AuthenticationData data = m_Database.Get(principalID); |
59 | string result = String.Empty; | 66 | string result = String.Empty; |
60 | if (data != null && data.Data != null) | 67 | if (data != null && data.Data != null) |
@@ -62,7 +69,7 @@ namespace OpenSim.Services.AuthenticationService | |||
62 | if (data.Data.ContainsKey("webLoginKey")) | 69 | if (data.Data.ContainsKey("webLoginKey")) |
63 | { | 70 | { |
64 | m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID); | 71 | m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID); |
65 | result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime); | 72 | result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime, out realID); |
66 | if (result == String.Empty) | 73 | if (result == String.Empty) |
67 | { | 74 | { |
68 | m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID); | 75 | m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID); |
@@ -71,12 +78,15 @@ namespace OpenSim.Services.AuthenticationService | |||
71 | if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) | 78 | if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) |
72 | { | 79 | { |
73 | m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID); | 80 | m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID); |
74 | result = m_svcChecks["password"].Authenticate(principalID, password, lifetime); | 81 | result = m_svcChecks["password"].Authenticate(principalID, password, lifetime, out realID); |
75 | if (result == String.Empty) | 82 | if (result == String.Empty) |
76 | { | 83 | { |
77 | m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID); | 84 | m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID); |
78 | } | 85 | } |
79 | } | 86 | } |
87 | |||
88 | realID = UUID.Zero; | ||
89 | |||
80 | if (result == string.Empty) | 90 | if (result == string.Empty) |
81 | { | 91 | { |
82 | m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID); | 92 | m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID); |
@@ -89,4 +99,4 @@ namespace OpenSim.Services.AuthenticationService | |||
89 | return result; | 99 | return result; |
90 | } | 100 | } |
91 | } | 101 | } |
92 | } \ No newline at end of file | 102 | } |
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs index 2b77154..f996aca 100644 --- a/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs +++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs | |||
@@ -81,6 +81,13 @@ namespace OpenSim.Services.Connectors | |||
81 | m_ServerURI = serviceURI; | 81 | m_ServerURI = serviceURI; |
82 | } | 82 | } |
83 | 83 | ||
84 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
85 | { | ||
86 | realID = UUID.Zero; | ||
87 | |||
88 | return Authenticate(principalID, password, lifetime); | ||
89 | } | ||
90 | |||
84 | public string Authenticate(UUID principalID, string password, int lifetime) | 91 | public string Authenticate(UUID principalID, string password, int lifetime) |
85 | { | 92 | { |
86 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 93 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 69f6ed2..331d485 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | |||
@@ -102,6 +102,11 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
102 | m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); | 102 | m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); |
103 | } | 103 | } |
104 | 104 | ||
105 | public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) | ||
106 | { | ||
107 | return Authenticate(principalID, password, lifetime); | ||
108 | } | ||
109 | |||
105 | public string Authenticate(UUID principalID, string password, int lifetime) | 110 | public string Authenticate(UUID principalID, string password, int lifetime) |
106 | { | 111 | { |
107 | NameValueCollection requestArgs = new NameValueCollection | 112 | NameValueCollection requestArgs = new NameValueCollection |
diff --git a/OpenSim/Services/Interfaces/IAuthenticationService.cs b/OpenSim/Services/Interfaces/IAuthenticationService.cs index cee8bc0..cdcfad9 100644 --- a/OpenSim/Services/Interfaces/IAuthenticationService.cs +++ b/OpenSim/Services/Interfaces/IAuthenticationService.cs | |||
@@ -67,6 +67,7 @@ namespace OpenSim.Services.Interfaces | |||
67 | // various services. | 67 | // various services. |
68 | // | 68 | // |
69 | string Authenticate(UUID principalID, string password, int lifetime); | 69 | string Authenticate(UUID principalID, string password, int lifetime); |
70 | string Authenticate(UUID principalID, string password, int lifetime, out UUID realID); | ||
70 | 71 | ||
71 | ////////////////////////////////////////////////////// | 72 | ////////////////////////////////////////////////////// |
72 | // Verification | 73 | // Verification |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index a4b3cbd..e2f947c 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -150,6 +150,7 @@ namespace OpenSim.Services.LLLoginService | |||
150 | private UUID agentID; | 150 | private UUID agentID; |
151 | private UUID sessionID; | 151 | private UUID sessionID; |
152 | private UUID secureSessionID; | 152 | private UUID secureSessionID; |
153 | private UUID realID; | ||
153 | 154 | ||
154 | // Login Flags | 155 | // Login Flags |
155 | private string dst; | 156 | private string dst; |
@@ -232,7 +233,7 @@ namespace OpenSim.Services.LLLoginService | |||
232 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, | 233 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, |
233 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, | 234 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, |
234 | GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency, | 235 | GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency, |
235 | string DSTZone) | 236 | string DSTZone, UUID realID) |
236 | : this() | 237 | : this() |
237 | { | 238 | { |
238 | FillOutInventoryData(invSkel, libService); | 239 | FillOutInventoryData(invSkel, libService); |
@@ -245,6 +246,7 @@ namespace OpenSim.Services.LLLoginService | |||
245 | AgentID = account.PrincipalID; | 246 | AgentID = account.PrincipalID; |
246 | SessionID = aCircuit.SessionID; | 247 | SessionID = aCircuit.SessionID; |
247 | SecureSessionID = aCircuit.SecureSessionID; | 248 | SecureSessionID = aCircuit.SecureSessionID; |
249 | RealID = realID; | ||
248 | Message = message; | 250 | Message = message; |
249 | BuddList = ConvertFriendListItem(friendsList); | 251 | BuddList = ConvertFriendListItem(friendsList); |
250 | StartLocation = where; | 252 | StartLocation = where; |
@@ -456,6 +458,7 @@ namespace OpenSim.Services.LLLoginService | |||
456 | SessionID = UUID.Random(); | 458 | SessionID = UUID.Random(); |
457 | SecureSessionID = UUID.Random(); | 459 | SecureSessionID = UUID.Random(); |
458 | AgentID = UUID.Random(); | 460 | AgentID = UUID.Random(); |
461 | RealID = UUID.Zero; | ||
459 | 462 | ||
460 | Hashtable InitialOutfitHash = new Hashtable(); | 463 | Hashtable InitialOutfitHash = new Hashtable(); |
461 | InitialOutfitHash["folder_name"] = "Nightclub Female"; | 464 | InitialOutfitHash["folder_name"] = "Nightclub Female"; |
@@ -499,6 +502,7 @@ namespace OpenSim.Services.LLLoginService | |||
499 | responseData["http_port"] = (Int32)SimHttpPort; | 502 | responseData["http_port"] = (Int32)SimHttpPort; |
500 | 503 | ||
501 | responseData["agent_id"] = AgentID.ToString(); | 504 | responseData["agent_id"] = AgentID.ToString(); |
505 | responseData["real_id"] = RealID.ToString(); | ||
502 | responseData["session_id"] = SessionID.ToString(); | 506 | responseData["session_id"] = SessionID.ToString(); |
503 | responseData["secure_session_id"] = SecureSessionID.ToString(); | 507 | responseData["secure_session_id"] = SecureSessionID.ToString(); |
504 | responseData["circuit_code"] = CircuitCode; | 508 | responseData["circuit_code"] = CircuitCode; |
@@ -581,6 +585,7 @@ namespace OpenSim.Services.LLLoginService | |||
581 | map["sim_ip"] = OSD.FromString(SimAddress); | 585 | map["sim_ip"] = OSD.FromString(SimAddress); |
582 | 586 | ||
583 | map["agent_id"] = OSD.FromUUID(AgentID); | 587 | map["agent_id"] = OSD.FromUUID(AgentID); |
588 | map["real_id"] = OSD.FromUUID(RealID); | ||
584 | map["session_id"] = OSD.FromUUID(SessionID); | 589 | map["session_id"] = OSD.FromUUID(SessionID); |
585 | map["secure_session_id"] = OSD.FromUUID(SecureSessionID); | 590 | map["secure_session_id"] = OSD.FromUUID(SecureSessionID); |
586 | map["circuit_code"] = OSD.FromInteger(CircuitCode); | 591 | map["circuit_code"] = OSD.FromInteger(CircuitCode); |
@@ -888,6 +893,12 @@ namespace OpenSim.Services.LLLoginService | |||
888 | set { secureSessionID = value; } | 893 | set { secureSessionID = value; } |
889 | } | 894 | } |
890 | 895 | ||
896 | public UUID RealID | ||
897 | { | ||
898 | get { return realID; } | ||
899 | set { realID = value; } | ||
900 | } | ||
901 | |||
891 | public Int32 CircuitCode | 902 | public Int32 CircuitCode |
892 | { | 903 | { |
893 | get { return circuitCode; } | 904 | get { return circuitCode; } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index ed887d9..988a9b9 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -327,7 +327,8 @@ namespace OpenSim.Services.LLLoginService | |||
327 | if (!passwd.StartsWith("$1$")) | 327 | if (!passwd.StartsWith("$1$")) |
328 | passwd = "$1$" + Util.Md5Hash(passwd); | 328 | passwd = "$1$" + Util.Md5Hash(passwd); |
329 | passwd = passwd.Remove(0, 3); //remove $1$ | 329 | passwd = passwd.Remove(0, 3); //remove $1$ |
330 | string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30); | 330 | UUID realID; |
331 | string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30, out realID); | ||
331 | UUID secureSession = UUID.Zero; | 332 | UUID secureSession = UUID.Zero; |
332 | if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) | 333 | if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) |
333 | { | 334 | { |
@@ -459,7 +460,7 @@ namespace OpenSim.Services.LLLoginService | |||
459 | = new LLLoginResponse( | 460 | = new LLLoginResponse( |
460 | account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, | 461 | account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, |
461 | where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, | 462 | where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, |
462 | m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone); | 463 | m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone, realID); |
463 | 464 | ||
464 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); | 465 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); |
465 | 466 | ||