/// <summary>
        /// Creates the URIs based on the baseUri.
        /// </summary>
        /// <param name="baseUri">The base URI.</param>
        /// <returns>STS Endpoints</returns>
        public static Endpoints Create(string baseUriString, int httpPort, int httpsPort)
        {
            var ep = new Endpoints();
            if (!baseUriString.EndsWith("/"))
            {
                baseUriString += "/";
            }
            
            // construct various http and https URIs
            var passive = new Uri(baseUriString + Paths.WSFedIssuePage);
            var builder = new UriBuilder(passive);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederation = builder.Uri;

            var hrd = new Uri(baseUriString + Paths.WSFedHRD);
            builder = new UriBuilder(hrd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationHRD = builder.Uri;

            // construct various http and https URIs
            var privacy = new Uri(baseUriString + Paths.PrivacyNotice);
            builder = new UriBuilder(privacy);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.PrivacyNotice = builder.Uri;

            var simpleHttp = new Uri(baseUriString + Paths.SimpleHttp);
            builder = new UriBuilder(simpleHttp);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.SimpleHttp = builder.Uri;

            var wrap = new Uri(baseUriString + Paths.Wrap);
            builder = new UriBuilder(wrap);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Wrap = builder.Uri;

            var oauth2token = new Uri(baseUriString + Paths.OAuth2Token);
            builder = new UriBuilder(oauth2token);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2Token = builder.Uri;
            
            var oauth2callback = new Uri(baseUriString + Paths.OAuth2Callback);
            builder = new UriBuilder(oauth2callback);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2Callback = builder.Uri;
            
            var oauth2auth = new Uri(baseUriString + Paths.OAuth2Authorize);
            builder = new UriBuilder(oauth2auth);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2Authorize = builder.Uri;

            var oidcAuthorize = new Uri(baseUriString + Paths.OidcAuthorize);
            builder = new UriBuilder(oidcAuthorize);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OidcAuthorize = builder.Uri;

            var oidcToken = new Uri(baseUriString + Paths.OidcToken);
            builder = new UriBuilder(oidcToken);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OidcToken = builder.Uri;

            var oidcUserInfo = new Uri(baseUriString + Paths.OidcUserInfo);
            builder = new UriBuilder(oidcUserInfo);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OidcUserInfo = builder.Uri;

            var jsnotify = new Uri(baseUriString + Paths.JSNotify);
            builder = new UriBuilder(jsnotify);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.JSNotify = builder.Uri;

            var wsfedmd = new Uri(baseUriString + Paths.WSFedMetadata);
            builder = new UriBuilder(wsfedmd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationMetadata = builder.Uri;
            
            var adfs = new Uri(baseUriString + Paths.AdfsIntegration);
            builder = new UriBuilder(adfs);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.AdfsIntegration = builder.Uri;

            var activeClear = new Uri(baseUriString + Paths.WSTrustBase);
            builder = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttp;
            builder.Port = httpPort;
            activeClear = builder.Uri;

            builder = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            var activeSsl = builder.Uri;

            ep.WSTrustMessageUserName = new Uri(activeClear + "/" + Paths.WSTrustMessageUserName);
            ep.WSTrustMixedUserName = new Uri(activeSsl + "/" + Paths.WSTrustMixedUserName);

            ep.WSTrustMessageCertificate = new Uri(activeClear + "/" + Paths.WSTrustMessageCertificate);
            ep.WSTrustMixedCertificate = new Uri(activeSsl + "/" + Paths.WSTrustMixedCertificate);

            ep.WSTrustMex = new Uri(activeSsl + "/" + Paths.Mex);

            return ep;
        }
        /// <summary>
        /// Creates the URIs based on the baseUri.
        /// </summary>
        /// <param name="baseUri">The base URI.</param>
        /// <returns>STS Endpoints</returns>
        public static Endpoints Create(string baseUriString, int httpPort, int httpsPort)
        {
            var ep = new Endpoints();
            if (baseUriString.EndsWith("/"))
            {
                baseUriString = baseUriString.Substring(0, baseUriString.Length - 1);
            }
            
            // construct various http and https URIs
            var passive = new Uri(baseUriString + Paths.WSFedIssuePage);
            var builder = new UriBuilder(passive);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederation = builder.Uri;

            // construct various http and https URIs
            var privacy = new Uri(baseUriString + Paths.PrivacyNotice);
            builder = new UriBuilder(privacy);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.PrivacyNotice = builder.Uri;

            var simpleHttp = new Uri(baseUriString + Paths.SimpleHttp);
            builder = new UriBuilder(simpleHttp);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.SimpleHttp = builder.Uri;

            var wrap = new Uri(baseUriString + Paths.Wrap);
            builder = new UriBuilder(wrap);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Wrap = builder.Uri;

            var oauth2 = new Uri(baseUriString + Paths.OAuth2);
            builder = new UriBuilder(oauth2);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2 = builder.Uri;

            var jsnotify = new Uri(baseUriString + Paths.JSNotify);
            builder = new UriBuilder(jsnotify);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.JSNotify = builder.Uri;

            var wsfedmd = new Uri(baseUriString + Paths.WSFedMetadata);
            builder = new UriBuilder(wsfedmd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationMetadata = builder.Uri;

            var activeClear = new Uri(baseUriString + Paths.WSTrustBase);
            builder = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttp;
            builder.Port = httpPort;
            activeClear = builder.Uri;

            builder = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            var activeSsl = builder.Uri;

            ep.WSTrustMessageUserName = new Uri(activeClear + Paths.WSTrustMessageUserName);
            ep.WSTrustMixedUserName = new Uri(activeSsl + Paths.WSTrustMixedUserName);

            ep.WSTrustMessageCertificate = new Uri(activeClear + Paths.WSTrustMessageCertificate);
            ep.WSTrustMixedCertificate = new Uri(activeSsl + Paths.WSTrustMixedCertificate);

            ep.WSTrustMex = new Uri(activeSsl + Paths.Mex);

            return ep;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates the URIs based on the baseUri.
        /// </summary>
        /// <param name="baseUri">The base URI.</param>
        /// <returns>STS Endpoints</returns>
        public static Endpoints Create(string baseUriString, int httpPort, int httpsPort)
        {
            var ep = new Endpoints();

            if (!baseUriString.EndsWith("/"))
            {
                baseUriString += "/";
            }

            // construct various http and https URIs
            var passive = new Uri(baseUriString + Paths.WSFedIssuePage);
            var builder = new UriBuilder(passive);

            builder.Scheme  = Uri.UriSchemeHttps;
            builder.Port    = httpsPort;
            ep.WSFederation = builder.Uri;

            var hrd = new Uri(baseUriString + Paths.WSFedHRD);

            builder            = new UriBuilder(hrd);
            builder.Scheme     = Uri.UriSchemeHttps;
            builder.Port       = httpsPort;
            ep.WSFederationHRD = builder.Uri;

            // construct various http and https URIs
            var privacy = new Uri(baseUriString + Paths.PrivacyNotice);

            builder          = new UriBuilder(privacy);
            builder.Scheme   = Uri.UriSchemeHttps;
            builder.Port     = httpsPort;
            ep.PrivacyNotice = builder.Uri;

            var simpleHttp = new Uri(baseUriString + Paths.SimpleHttp);

            builder        = new UriBuilder(simpleHttp);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.SimpleHttp  = builder.Uri;

            var wrap = new Uri(baseUriString + Paths.Wrap);

            builder        = new UriBuilder(wrap);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.Wrap        = builder.Uri;

            var oauth2token = new Uri(baseUriString + Paths.OAuth2Token);

            builder        = new UriBuilder(oauth2token);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.OAuth2Token = builder.Uri;

            var oauth2callback = new Uri(baseUriString + Paths.OAuth2Callback);

            builder           = new UriBuilder(oauth2callback);
            builder.Scheme    = Uri.UriSchemeHttps;
            builder.Port      = httpsPort;
            ep.OAuth2Callback = builder.Uri;

            var oauth2auth = new Uri(baseUriString + Paths.OAuth2Authorize);

            builder            = new UriBuilder(oauth2auth);
            builder.Scheme     = Uri.UriSchemeHttps;
            builder.Port       = httpsPort;
            ep.OAuth2Authorize = builder.Uri;

            var oidcAuthorize = new Uri(baseUriString + Paths.OidcAuthorize);

            builder          = new UriBuilder(oidcAuthorize);
            builder.Scheme   = Uri.UriSchemeHttps;
            builder.Port     = httpsPort;
            ep.OidcAuthorize = builder.Uri;

            var oidcToken = new Uri(baseUriString + Paths.OidcToken);

            builder        = new UriBuilder(oidcToken);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.OidcToken   = builder.Uri;

            var oidcUserInfo = new Uri(baseUriString + Paths.OidcUserInfo);

            builder         = new UriBuilder(oidcUserInfo);
            builder.Scheme  = Uri.UriSchemeHttps;
            builder.Port    = httpsPort;
            ep.OidcUserInfo = builder.Uri;

            var jsnotify = new Uri(baseUriString + Paths.JSNotify);

            builder        = new UriBuilder(jsnotify);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.JSNotify    = builder.Uri;

            var wsfedmd = new Uri(baseUriString + Paths.WSFedMetadata);

            builder                 = new UriBuilder(wsfedmd);
            builder.Scheme          = Uri.UriSchemeHttps;
            builder.Port            = httpsPort;
            ep.WSFederationMetadata = builder.Uri;

            var adfs = new Uri(baseUriString + Paths.AdfsIntegration);

            builder            = new UriBuilder(adfs);
            builder.Scheme     = Uri.UriSchemeHttps;
            builder.Port       = httpsPort;
            ep.AdfsIntegration = builder.Uri;

            var activeClear = new Uri(baseUriString + Paths.WSTrustBase);

            builder        = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttp;
            builder.Port   = httpPort;
            activeClear    = builder.Uri;

            builder        = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            var activeSsl = builder.Uri;

            ep.WSTrustMessageUserName = new Uri(activeClear + "/" + Paths.WSTrustMessageUserName);
            ep.WSTrustMixedUserName   = new Uri(activeSsl + "/" + Paths.WSTrustMixedUserName);

            ep.WSTrustMessageCertificate = new Uri(activeClear + "/" + Paths.WSTrustMessageCertificate);
            ep.WSTrustMixedCertificate   = new Uri(activeSsl + "/" + Paths.WSTrustMixedCertificate);

            ep.WSTrustMex = new Uri(activeSsl + "/" + Paths.Mex);

            return(ep);
        }
        /// <summary>
        /// Creates the URIs based on the baseUri.
        /// </summary>
        /// <param name="baseUri">The base URI.</param>
        /// <returns>STS Endpoints</returns>
        public static Endpoints Create(string baseUriString, int httpPort, int httpsPort)
        {
            var ep = new Endpoints();
            if (!baseUriString.EndsWith("/"))
            {
                baseUriString += "/";
            }
            
            // construct various http and https URIs
            var passive = new Uri(baseUriString + Paths.WSFedIssuePage);
            var builder = new UriBuilder(passive);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederation = builder.Uri;

            var saml = new Uri(baseUriString + Paths.WSSaml2Page);
            builder = new UriBuilder(saml);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSSAML2 = builder.Uri;

            var hrd = new Uri(baseUriString + Paths.WSFedHRD);
            builder = new UriBuilder(hrd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationHRD = builder.Uri;

            // construct various http and https URIs
            var privacy = new Uri(baseUriString + Paths.PrivacyNotice);
            builder = new UriBuilder(privacy);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.PrivacyNotice = builder.Uri;

            var simpleHttp = new Uri(baseUriString + Paths.SimpleHttp);
            builder = new UriBuilder(simpleHttp);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.SimpleHttp = builder.Uri;

            var wrap = new Uri(baseUriString + Paths.Wrap);
            builder = new UriBuilder(wrap);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Wrap = builder.Uri;

            var oauth2token = new Uri(baseUriString + Paths.OAuth2Token);
            builder = new UriBuilder(oauth2token);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2Token = builder.Uri;
            
            var oauth2callback = new Uri(baseUriString + Paths.OAuth2Callback);
            builder = new UriBuilder(oauth2callback);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2Callback = builder.Uri;
            
            var oauth2auth = new Uri(baseUriString + Paths.OAuth2Authorize);
            builder = new UriBuilder(oauth2auth);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.OAuth2Authorize = builder.Uri;

            var jsnotify = new Uri(baseUriString + Paths.JSNotify);
            builder = new UriBuilder(jsnotify);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.JSNotify = builder.Uri;

            var wsfedmd = new Uri(baseUriString + Paths.WSFedMetadata);
            builder = new UriBuilder(wsfedmd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationMetadata = builder.Uri;

            var saml2pmd = new Uri(baseUriString + Paths.Saml2Metadata);
            builder = new UriBuilder(saml2pmd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2Metadata = builder.Uri;

            //
            var saml2psloredirect= new Uri(baseUriString + Paths.Saml2SLORedirect);
            builder = new UriBuilder(saml2psloredirect);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2SLORedirect = builder.Uri;

            var saml2psloredirectresponse = new Uri(baseUriString + Paths.Saml2SLORedirectResponse);
            builder = new UriBuilder(saml2psloredirectresponse);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2SLORedirectResponse = builder.Uri;

            var saml2pslopostresponse = new Uri(baseUriString + Paths.Saml2SLOPostResponse);
            builder = new UriBuilder(saml2pslopostresponse);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2SLOPostResponse = builder.Uri;

            var saml2pslopost = new Uri(baseUriString + Paths.Saml2SLOPOST);
            builder = new UriBuilder(saml2pslopost);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2SLOPOST = builder.Uri;

            var saml2pastredirect  = new Uri(baseUriString + Paths.Saml2ASTRedirect);
            builder = new UriBuilder(saml2pastredirect);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2ASTRedirect = builder.Uri;

            var saml2pastpost  = new Uri(baseUriString + Paths.Saml2ASTPost);
            builder = new UriBuilder(saml2pastpost);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2ASTPost = builder.Uri;

            var saml2partifact  = new Uri(baseUriString + Paths.Saml2ASTArtifact);
            builder = new UriBuilder(saml2partifact);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.Saml2ASTArtifact = builder.Uri;
            //

            var activeClear = new Uri(baseUriString + Paths.WSTrustBase);
            builder = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttp;
            builder.Port = httpPort;
            activeClear = builder.Uri;

            builder = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            var activeSsl = builder.Uri;

            ep.WSTrustMessageUserName = new Uri(activeClear, Paths.WSTrustMessageUserName);
            ep.WSTrustMixedUserName = new Uri(activeSsl, Paths.WSTrustMixedUserName);

            ep.WSTrustMessageCertificate = new Uri(activeClear, Paths.WSTrustMessageCertificate);
            ep.WSTrustMixedCertificate = new Uri(activeSsl, Paths.WSTrustMixedCertificate);

            ep.WSTrustMex = new Uri(activeSsl, Paths.Mex);

            return ep;
        }
        /// <summary>
        /// Creates the URIs based on the baseUri.
        /// </summary>
        /// <param name="baseUri">The base URI.</param>
        /// <returns>STS Endpoints</returns>
        public static Endpoints Create(string baseUriString, int httpPort, int httpsPort)
        {
            var ep = new Endpoints();

            if (baseUriString.EndsWith("/"))
            {
                baseUriString = baseUriString.Substring(0, baseUriString.Length - 1);
            }

            // construct various http and https URIs
            var passive = new Uri(baseUriString + Paths.WSFedIssuePage);
            var builder = new UriBuilder(passive);

            builder.Scheme  = Uri.UriSchemeHttps;
            builder.Port    = httpsPort;
            ep.WSFederation = builder.Uri;

            // construct various http and https URIs
            var privacy = new Uri(baseUriString + Paths.PrivacyNotice);

            builder          = new UriBuilder(privacy);
            builder.Scheme   = Uri.UriSchemeHttps;
            builder.Port     = httpsPort;
            ep.PrivacyNotice = builder.Uri;

            var simpleHttp = new Uri(baseUriString + Paths.SimpleHttp);

            builder        = new UriBuilder(simpleHttp);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.SimpleHttp  = builder.Uri;

            var wrap = new Uri(baseUriString + Paths.Wrap);

            builder        = new UriBuilder(wrap);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.Wrap        = builder.Uri;

            var oauth2 = new Uri(baseUriString + Paths.OAuth2);

            builder        = new UriBuilder(oauth2);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.OAuth2      = builder.Uri;

            var jsnotify = new Uri(baseUriString + Paths.JSNotify);

            builder        = new UriBuilder(jsnotify);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            ep.JSNotify    = builder.Uri;

            var wsfedmd = new Uri(baseUriString + Paths.WSFedMetadata);

            builder                 = new UriBuilder(wsfedmd);
            builder.Scheme          = Uri.UriSchemeHttps;
            builder.Port            = httpsPort;
            ep.WSFederationMetadata = builder.Uri;

            var activeClear = new Uri(baseUriString + Paths.WSTrustBase);

            builder        = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttp;
            builder.Port   = httpPort;
            activeClear    = builder.Uri;

            builder        = new UriBuilder(activeClear);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port   = httpsPort;
            var activeSsl = builder.Uri;

            ep.WSTrustMessageUserName = new Uri(activeClear + Paths.WSTrustMessageUserName);
            ep.WSTrustMixedUserName   = new Uri(activeSsl + Paths.WSTrustMixedUserName);

            ep.WSTrustMessageCertificate = new Uri(activeClear + Paths.WSTrustMessageCertificate);
            ep.WSTrustMixedCertificate   = new Uri(activeSsl + Paths.WSTrustMixedCertificate);

            ep.WSTrustMex = new Uri(activeSsl + Paths.Mex);

            return(ep);
        }