本文整理汇总了C#中OpenSim.Services.Connectors.Hypergrid.UserAgentServiceConnector.VerifyAgent方法的典型用法代码示例。如果您正苦于以下问题:C# UserAgentServiceConnector.VerifyAgent方法的具体用法?C# UserAgentServiceConnector.VerifyAgent怎么用?C# UserAgentServiceConnector.VerifyAgent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Services.Connectors.Hypergrid.UserAgentServiceConnector
的用法示例。
在下文中一共展示了UserAgentServiceConnector.VerifyAgent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Authenticate
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)
{
m_log.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
{
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
return false;
}
}
}
return false;
}
示例2: Authenticate
protected bool Authenticate(AgentCircuitData aCircuit, out string message)
{
message = "";
if (!CheckAddress(aCircuit.ServiceSessionID))
{
message = "Please use " + m_Uri.GetLeftPart(UriPartial.Authority) + " instead.";
return false;
}
if (string.IsNullOrEmpty(aCircuit.IPAddress))
{
m_log.DebugFormat("[GATEKEEPER SERVICE]: Agent did not provide a client IP address.");
return false;
}
string userURL = string.Empty;
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
userURL = aCircuit.ServiceURLs["HomeURI"].ToString();
if (userURL == string.Empty)
{
m_log.DebugFormat("[GATEKEEPER SERVICE]: Agent did not provide an authentication server URL");
message = "Agent did not provide an authentication server URL.";
return false;
}
if (userURL == m_ExternalName)
{
return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
}
else
{
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL);
try
{
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
}
catch
{
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
message = string.Format("Unable to contact authentication service at {0}.", userURL);
return false;
}
}
}