diff options
author | Melanie | 2012-08-15 23:31:38 +0200 |
---|---|---|
committer | Melanie | 2012-08-15 23:31:38 +0200 |
commit | c313de630f2fec6793da2bc1f51dd54be82cb3e8 (patch) | |
tree | 5c8b5800bc1cbad6c2d882deba0ba93aac21f2b3 /OpenSim/Services/AuthenticationService | |
parent | Implementing PRIM_LINK_TARGET in a non-recursive fashion (diff) | |
download | opensim-SC_OLD-c313de630f2fec6793da2bc1f51dd54be82cb3e8.zip opensim-SC_OLD-c313de630f2fec6793da2bc1f51dd54be82cb3e8.tar.gz opensim-SC_OLD-c313de630f2fec6793da2bc1f51dd54be82cb3e8.tar.bz2 opensim-SC_OLD-c313de630f2fec6793da2bc1f51dd54be82cb3e8.tar.xz |
Add a real_id field to the login response if impersonation is used. The wrapper
script needs this for proper logging.
Diffstat (limited to 'OpenSim/Services/AuthenticationService')
3 files changed, 30 insertions, 3 deletions
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 | } |