aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs')
-rw-r--r--OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs23
1 files changed, 12 insertions, 11 deletions
diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
index 5924026..2344c0e 100644
--- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
@@ -57,10 +57,9 @@ namespace OpenSim.Services.AuthenticationService
57 57
58 public string Authenticate(UUID principalID, string password, int lifetime) 58 public string Authenticate(UUID principalID, string password, int lifetime)
59 { 59 {
60 m_log.InfoFormat("[Authenticate]: Trying a web key authenticate");
61 if (new UUID(password) == UUID.Zero) 60 if (new UUID(password) == UUID.Zero)
62 { 61 {
63 m_log.InfoFormat("[Authenticate]: NULL_KEY is not a valid web_login_key"); 62 m_log.DebugFormat("[AUTH SERVICE]: UUID.Zero is not a valid web_login_key on PrincipalID {0}", principalID);
64 } 63 }
65 else 64 else
66 { 65 {
@@ -69,17 +68,19 @@ namespace OpenSim.Services.AuthenticationService
69 { 68 {
70 if (data.Data.ContainsKey("webLoginKey")) 69 if (data.Data.ContainsKey("webLoginKey"))
71 { 70 {
72 m_log.InfoFormat("[Authenticate]: Trying a web key authentication");
73 string key = data.Data["webLoginKey"].ToString(); 71 string key = data.Data["webLoginKey"].ToString();
74 m_log.DebugFormat("[WEB LOGIN AUTH]: got {0} for key in db vs {1}", key, password); 72 if (key == password)
75 if (key == password) 73 {
76 { 74 data.Data["webLoginKey"] = UUID.Zero.ToString();
77 data.Data["webLoginKey"] = UUID.Zero.ToString(); 75 m_Database.Store(data);
78 m_Database.Store(data); 76 return GetToken(principalID, lifetime);
79 return GetToken(principalID, lifetime); 77 }
80 } 78 else
79 {
80 m_log.DebugFormat("[AUTH SERVICE]: web login auth failed, got PrincipalID {0} gave {1} instead of {2}", principalID, password, key);
81 }
81 }else{ 82 }else{
82 m_log.DebugFormat("[Authenticate]: no col webLoginKey in passwd.db"); 83 m_log.DebugFormat("[AUTH SERVICE]: no col webLoginKey in passwd.db");
83 } 84 }
84 } 85 }
85 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); 86 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID);