aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
diff options
context:
space:
mode:
authorSignpostMarv Martin2011-03-15 10:29:24 +0000
committerJustin Clark-Casey (justincc)2011-03-26 02:28:11 +0000
commit482686daab055d4d2d878b238059b442e64122f4 (patch)
treeb48496c8816f5bdb5a1aee76406bea281e7d0c13 /OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
parentWhen an object is duplicated, add it to the full/local id SOG indexes as well... (diff)
downloadopensim-SC_OLD-482686daab055d4d2d878b238059b442e64122f4.zip
opensim-SC_OLD-482686daab055d4d2d878b238059b442e64122f4.tar.gz
opensim-SC_OLD-482686daab055d4d2d878b238059b442e64122f4.tar.bz2
opensim-SC_OLD-482686daab055d4d2d878b238059b442e64122f4.tar.xz
WebkeyAuthenticationService is now no longer a stub!
Signed-off-by: SignpostMarv Martin <me@signpostmarv.name>
Diffstat (limited to 'OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs')
-rw-r--r--OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs40
1 files changed, 35 insertions, 5 deletions
diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
index d1a5b0f..a072958 100644
--- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs
@@ -31,6 +31,9 @@ using OpenSim.Services.Interfaces;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using System.Reflection; 33using System.Reflection;
34using OpenSim.Data;
35using OpenSim.Framework;
36using OpenSim.Framework.Console;
34 37
35namespace OpenSim.Services.AuthenticationService 38namespace OpenSim.Services.AuthenticationService
36{ 39{
@@ -43,17 +46,44 @@ namespace OpenSim.Services.AuthenticationService
43 public class WebkeyAuthenticationService : 46 public class WebkeyAuthenticationService :
44 AuthenticationServiceBase, IAuthenticationService 47 AuthenticationServiceBase, IAuthenticationService
45 { 48 {
46// private static readonly ILog m_log = 49 private static readonly ILog m_log =
47// LogManager.GetLogger( 50 LogManager.GetLogger(
48// MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
49 52
50 public WebkeyAuthenticationService(IConfigSource config) : 53 public WebkeyAuthenticationService(IConfigSource config) :
51 base(config) 54 base(config)
52 { 55 {
53 } 56 }
54 57
55 public string Authenticate(UUID principalID, string password, int lifetime) 58 public string Authenticate(UUID principalID, string password, int lifetime)
56 { 59 {
60 m_log.InfoFormat("[Authenticate]: Trying a web key authenticate");
61 if (new UUID(password) == UUID.Zero)
62 {
63 m_log.InfoFormat("[Authenticate]: NULL_KEY is not a valid web_login_key");
64 }
65 else
66 {
67 AuthenticationData data = m_Database.Get(principalID);
68 if (data != null && data.Data != null)
69 {
70 if (data.Data.ContainsKey("webLoginKey"))
71 {
72 m_log.InfoFormat("[Authenticate]: Trying a web key authentication");
73 string key = data.Data["webLoginKey"].ToString();
74 m_log.DebugFormat("[WEB LOGIN AUTH]: got {0} for key in db vs {1}", key, password);
75 if (key == password)
76 {
77 data.Data["webLoginKey"] = UUID.Zero.ToString();
78 m_Database.Store(data);
79 return GetToken(principalID, lifetime);
80 }
81 }else{
82 m_log.InfoFormat("[Authenticate]: no col webLoginKey in passwd.db");
83 }
84 }
85 m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID);
86 }
57 return String.Empty; 87 return String.Empty;
58 } 88 }
59 } 89 }