本文整理匯總了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;
}
}
}