Aurora.Addon.HyperGrid.GatekeeperService.Authenticate C# (CSharp) Method

Authenticate() protected method

protected Authenticate ( Aurora.Framework.AgentCircuitData aCircuit ) : bool
aCircuit Aurora.Framework.AgentCircuitData
return bool
        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;
        }