protected bool Authenticate(AgentCircuitData aCircuit)
{
if (!CheckAddress (aCircuit.ServiceSessionID))
return false;
string userURL = string.Empty;
if (aCircuit.ServiceURLs.ContainsKey ("HomeURI"))
userURL = aCircuit.ServiceURLs["HomeURI"].ToString ();
if (userURL == string.Empty)
{
MainConsole.Instance.DebugFormat ("[GATEKEEPER SERVICE]: Agent did not provide an authentication server URL");
return false;
}
if (userURL == m_ExternalName)
return m_UserAgentService.VerifyAgent (aCircuit.SessionID, aCircuit.ServiceSessionID);
else
{
// Object[] args = new Object[] { userURL };
IUserAgentService userAgentService = new UserAgentServiceConnector (userURL);
if (userAgentService != null)
{
try
{
return userAgentService.VerifyAgent (aCircuit.SessionID, aCircuit.ServiceSessionID);
}
catch
{
MainConsole.Instance.DebugFormat ("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
return false;
}
}
}
return false;
}