diff options
Diffstat (limited to 'OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs')
-rw-r--r-- | OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs index c315ef2..15dc5be 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs | |||
@@ -16,25 +16,25 @@ namespace OpenSim.Services.AuthenticationService | |||
16 | { | 16 | { |
17 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 17 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
18 | private IConfigSource config; | 18 | private IConfigSource config; |
19 | private Dictionary<string, IAuthenticationService> svc_checks; | ||
19 | public WebkeyOrPasswordAuthenticationService(IConfigSource config) | 20 | public WebkeyOrPasswordAuthenticationService(IConfigSource config) |
20 | : base(config) | 21 | : base(config) |
21 | { | 22 | { |
22 | this.config = config; | 23 | this.config = config; |
24 | svc_checks["web_login_key"] = new WebkeyAuthenticationService(config); | ||
25 | svc_checks["password"] = new PasswordAuthenticationService(config); | ||
23 | } | 26 | } |
24 | 27 | ||
25 | public string Authenticate(UUID principalID, string password, int lifetime) | 28 | public string Authenticate(UUID principalID, string password, int lifetime) |
26 | { | 29 | { |
27 | AuthenticationData data = m_Database.Get(principalID); | 30 | AuthenticationData data = m_Database.Get(principalID); |
28 | IAuthenticationService svc; | ||
29 | Object[] args = new Object[] { config }; | ||
30 | string result = String.Empty; | 31 | string result = String.Empty; |
31 | if (data != null && data.Data != null) | 32 | if (data != null && data.Data != null) |
32 | { | 33 | { |
33 | if (data.Data.ContainsKey("webLoginKey")) | 34 | if (data.Data.ContainsKey("webLoginKey")) |
34 | { | 35 | { |
35 | m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID); | 36 | m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID); |
36 | svc = ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Services.AuthenticationService.dll", "WebkeyAuthenticationService", args); | 37 | result = svc_checks["web_login_key"].Authenticate(principalID, password, lifetime); |
37 | result = svc.Authenticate(principalID, password, lifetime); | ||
38 | if (result == String.Empty) | 38 | if (result == String.Empty) |
39 | { | 39 | { |
40 | m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID); | 40 | m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID); |
@@ -43,8 +43,7 @@ namespace OpenSim.Services.AuthenticationService | |||
43 | if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) | 43 | if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) |
44 | { | 44 | { |
45 | m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID); | 45 | m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID); |
46 | svc = ServerUtils.LoadPlugin<IAuthenticationService>("OpenSim.Services.AuthenticationService.dll", "PasswordAuthenticationService", args); | 46 | result = svc_checks["password"].Authenticate(principalID, password, lifetime); |
47 | result = svc.Authenticate(principalID, password, lifetime); | ||
48 | if (result == String.Empty) | 47 | if (result == String.Empty) |
49 | { | 48 | { |
50 | m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID); | 49 | m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID); |