Example #1
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;

            var az = new Uri(baseUriString + Paths.WSFedAZ);
            builder = new UriBuilder(az);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationAZ = builder.Uri;

            var ldap = new Uri(baseUriString + Paths.LdapSignIn);
            builder = new UriBuilder(ldap);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.LdapSignInUri = 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 wsfedrpmd = new Uri(baseUriString + Paths.WSFedRPMetadata);
            builder = new UriBuilder(wsfedrpmd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationRPMetadata = builder.Uri;

            var wsfedazmd = new Uri(baseUriString + Paths.WSFedAZMetadata);
            builder = new UriBuilder(wsfedazmd);
            builder.Scheme = Uri.UriSchemeHttps;
            builder.Port = httpsPort;
            ep.WSFederationAZMetadata = 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;
        }
Example #2
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;

            var az = new Uri(baseUriString + Paths.WSFedAZ);

            builder           = new UriBuilder(az);
            builder.Scheme    = Uri.UriSchemeHttps;
            builder.Port      = httpsPort;
            ep.WSFederationAZ = builder.Uri;

            var ldap = new Uri(baseUriString + Paths.LdapSignIn);

            builder          = new UriBuilder(ldap);
            builder.Scheme   = Uri.UriSchemeHttps;
            builder.Port     = httpsPort;
            ep.LdapSignInUri = 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 wsfedrpmd = new Uri(baseUriString + Paths.WSFedRPMetadata);

            builder                   = new UriBuilder(wsfedrpmd);
            builder.Scheme            = Uri.UriSchemeHttps;
            builder.Port              = httpsPort;
            ep.WSFederationRPMetadata = builder.Uri;

            var wsfedazmd = new Uri(baseUriString + Paths.WSFedAZMetadata);

            builder                   = new UriBuilder(wsfedazmd);
            builder.Scheme            = Uri.UriSchemeHttps;
            builder.Port              = httpsPort;
            ep.WSFederationAZMetadata = 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);
        }