示例#1
0
        public void BrowserBasedSecurityContext_WithForceInstanceTrue_GetsDifferentToken()
        {
            var ecsAddress = "http://devtitan.FCSAmerica.com/EnterpriseConfigurationStore/v1/RESTServices/api/ConfigItems";

            var firstSecurityContext = BrowserBasedSecurityContext.GetInstance(ecsAddress, "DocIndexer", "FCSA", forceNewInstance: false);

            Assert.IsNotNull(firstSecurityContext);
            Assert.IsNotNull(firstSecurityContext.ServiceToken);
            var firstRetrievedServiceToken = firstSecurityContext.ServiceToken;

            Console.WriteLine("ApplicationName:" + firstSecurityContext.ApplicationName);
            Console.WriteLine("PartnerName:" + firstSecurityContext.PartnerName);
            Console.WriteLine("FirstServiceToken:" + firstSecurityContext.ServiceToken);


            var secondSecurityContext = BrowserBasedSecurityContext.GetInstance(ecsAddress, "DocIndexer", "FCSA", forceNewInstance: true);

            Assert.IsNotNull(secondSecurityContext);
            Assert.IsNotNull(secondSecurityContext.ServiceToken);
            var secondRetrievedServiceToken = secondSecurityContext.ServiceToken;

            Assert.AreNotEqual(firstRetrievedServiceToken, secondRetrievedServiceToken);
            Console.WriteLine("ApplicationName:" + secondSecurityContext.ApplicationName);
            Console.WriteLine("PartnerName:" + secondSecurityContext.PartnerName);
            Console.WriteLine("SecondServiceToken:" + secondSecurityContext.ServiceToken);
        }
示例#2
0
        public void BrowserBasedSecurityContext_WithDocuClickProxyAddress_GetTokenAndAuditInfo(string partnerName)
        {
            var ecsAddress      = "https://devinternal.fcsamerica.net/DocuClick/v4/REST/api/Proxy/EnterpriseConfigurationStore/v1/ConfigItems/";
            var securityContext = BrowserBasedSecurityContext.GetInstance(ecsAddress, "DocIndexer", partnerName, forceNewInstance: true);

            Assert.IsNotNull(securityContext);
            Assert.IsNotNull(securityContext.ServiceToken);

            Console.WriteLine("ApplicationName:" + securityContext.ApplicationName);
            Console.WriteLine("PartnerName:" + securityContext.PartnerName);
            Console.WriteLine("ServiceToken:" + securityContext.ServiceToken);
            Console.WriteLine("AuditInfo:" + securityContext.AuditInfo);
        }
示例#3
0
        public void BrowserBasedSecurityContext_WithECSAddress_GetsTokenAndAuditInfo(string partnerName)
        {
            var ecsAddress = "http://devtitan.FCSAmerica.com/EnterpriseConfigurationStore/v1/RESTServices/api/ConfigItems";

            var securityContext = BrowserBasedSecurityContext.GetInstance(ecsAddress, "DocIndexer", partnerName, forceNewInstance: true);

            Assert.IsNotNull(securityContext);

            Assert.IsNotNull(securityContext.ServiceToken);
            Assert.IsNotNull(securityContext.AuditInfo);
            Console.WriteLine("ApplicationName:" + securityContext.ApplicationName);
            Console.WriteLine("PartnerName:" + securityContext.PartnerName);
            Console.WriteLine("ServiceToken:" + securityContext.ServiceToken);
            Console.WriteLine("AuditInfo:" + securityContext.AuditInfo);
        }
示例#4
0
        static void Main(string[] args)
        {
            var ecsAddress      = ConfigurationManager.AppSettings["ECSServerAddress"];
            var applicationName = ConfigurationManager.AppSettings["ApplicationName"];
            var partnerName     = ConfigurationManager.AppSettings["PartnerName"];

            var securityContext = BrowserBasedSecurityContext.GetInstance(applicationName, partnerName);

            Console.WriteLine("ApplicationName:" + securityContext.ApplicationName);
            Console.WriteLine("PartnerName:" + securityContext.PartnerName);
            Console.WriteLine("\nServiceToken:" + securityContext.ServiceToken);
            Console.WriteLine("\nAuditInfo:" + securityContext.AuditInfo);
            Console.WriteLine("\nDecoded AuditInfo:" + DecodedBase64(securityContext.AuditInfo));

            Console.ReadLine();
        }