예제 #1
0
        public override ServiceHostBase CreateServiceHost(string constructorString, Uri[] baseAddresses)
        {
            string issuerName = WebConfigurationManager.AppSettings["IssuerName"];
            string signingCertificateThumbPrint = WebConfigurationManager.AppSettings["SigningCertificateThumbprint"];
            string issuerCertificateThumbPrint = WebConfigurationManager.AppSettings["IssuerCertificateThumprint"];
            var config = new STSConfiguration(issuerName, signingCertificateThumbPrint, issuerCertificateThumbPrint);

            Uri baseuri = baseAddresses.FirstOrDefault(x => x.Scheme == Uri.UriSchemeHttps);
            if (baseuri == null)
            {
                throw new FaultException("The STS should be hosed in https");
            }

            WSTrustServiceHost host = new WSTrustServiceHost(config, baseAddresses);
            host.AddServiceEndpoint(typeof(IWSTrust13SyncContract), STSBinging, baseuri.AbsoluteUri);
            return host;
        }
예제 #2
0
        public override ServiceHostBase CreateServiceHost(string constructorString, Uri[] baseAddresses)
        {
            string issuerName = WebConfigurationManager.AppSettings["IssuerName"];
            string signingCertificateThumbPrint = WebConfigurationManager.AppSettings["SigningCertificateThumbprint"];
            string issuerCertificateThumbPrint  = WebConfigurationManager.AppSettings["IssuerCertificateThumprint"];
            var    config = new STSConfiguration(issuerName, signingCertificateThumbPrint, issuerCertificateThumbPrint);

            Uri baseuri = baseAddresses.FirstOrDefault(x => x.Scheme == Uri.UriSchemeHttps);

            if (baseuri == null)
            {
                throw new FaultException("The STS should be hosed in https");
            }

            WSTrustServiceHost host = new WSTrustServiceHost(config, baseAddresses);

            host.AddServiceEndpoint(typeof(IWSTrust13SyncContract), STSBinging, baseuri.AbsoluteUri);
            return(host);
        }