29 using System.Collections.Generic;
31 using OpenSim.Services.Interfaces;
34 using System.Reflection;
36 using OpenSim.Framework;
37 using OpenSim.Framework.Console;
38 using OpenSim.Server.Base;
40 namespace OpenSim.Services.AuthenticationService
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 private Dictionary<string, IAuthenticationService> m_svcChecks
47 =
new Dictionary<string, IAuthenticationService>();
56 public string Authenticate(UUID principalID,
string password,
int lifetime)
60 return Authenticate(principalID, password, lifetime, out realID);
63 public string Authenticate(UUID principalID,
string password,
int lifetime, out UUID realID)
66 string result = String.Empty;
68 if (data != null && data.
Data != null)
70 if (data.
Data.ContainsKey(
"webLoginKey"))
72 m_log.DebugFormat(
"[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID);
73 result = m_svcChecks[
"web_login_key"].Authenticate(principalID, password, lifetime, out realID);
74 if (result == String.Empty)
76 m_log.DebugFormat(
"[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID);
79 if (result ==
string.Empty && data.
Data.ContainsKey(
"passwordHash") && data.Data.ContainsKey(
"passwordSalt"))
81 m_log.DebugFormat(
"[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID);
82 result = m_svcChecks[
"password"].Authenticate(principalID, password, lifetime, out realID);
83 if (result == String.Empty)
85 m_log.DebugFormat(
"[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID);
91 if (result ==
string.Empty)
93 m_log.DebugFormat(
"[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID);
98 m_log.DebugFormat(
"[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID);
string Authenticate(UUID principalID, string password, int lifetime)
WebkeyOrPasswordAuthenticationService(IConfigSource config)
Dictionary< string, object > Data
string Authenticate(UUID principalID, string password, int lifetime, out UUID realID)