Example #1
0
        /// <summary>
        /// Authenticate to a remote Simias server
        /// </summary>
        /// <returns>Simias.Client.Authentication.Status object</returns>
        public Status Authenticate(Uri webServiceUri, string simiasDataPath)
        {
            Status status = null;

            try
            {
                SimiasWebService simiasSvc = new SimiasWebService();
                simiasSvc.Url = webServiceUri.ToString() + "/Simias.asmx";
                LocalService.Start(simiasSvc, webServiceUri, simiasDataPath);

                DomainInformation cInfo = simiasSvc.GetDomainInformation(this.domainID);
                if (cInfo != null)
                {
                    // Call Simias for a remote domain authentication
                    status = simiasSvc.LoginToRemoteDomain(this.domainID, this.password);
                }
                else
                {
                    //status = new Status( StatusCodes.UnknownDomain );
                }
            }
            catch (Exception ex)
            {
                // DEBUG
                if (MyEnvironment.Mono)
                {
                    Console.WriteLine("Authentication - caught exception: {0}", ex.Message);
                }

                //status = new Status( StatusCodes.InternalException );
                //status.ExceptionMessage = ex.Message;
            }

            return(status);
        }