Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Updated AppIntegration page
Browse files Browse the repository at this point in the history
  • Loading branch information
leastprivilege committed Oct 4, 2012
1 parent 83c4b08 commit 07112b1
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 19 deletions.
8 changes: 8 additions & 0 deletions src/Libraries/Thinktecture.IdentityServer.Core/Endpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace Thinktecture.IdentityServer
public class Endpoints
{
public Uri WSFederation { get; set; }
public Uri WSFederationHRD { get; set; }
public Uri WSFederationMetadata { get; set; }
public Uri WSTrustMex { get; set; }
public Uri PrivacyNotice { get; set; }
Expand All @@ -30,6 +31,7 @@ public class Endpoints
public static class Paths
{
public const string WSFedIssuePage = "/issue/wsfed";
public const string WSFedHRD = "/issue/hrd";
public const string WSFedMetadata = "/FederationMetadata/2007-06/FederationMetadata.xml";
public const string PrivacyNotice = "/privacyNotice.txt";
public const string WSTrustBase = "/issue/wstrust";
Expand Down Expand Up @@ -73,6 +75,12 @@ public static Endpoints Create(string baseUriString, int httpPort, int httpsPort
builder.Port = httpsPort;
ep.WSFederation = builder.Uri;

var hrd = new Uri(baseUriString + Paths.WSFedHRD);
builder = new UriBuilder(passive);
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Thinktecture.IdentityServer.Web.Controllers
public class HomeController : Controller
{
[Import]
public IConfigurationRepository ConfigurationRepository { get; set; }
public IConfigurationRepository Configuration { get; set; }

public HomeController()
{
Expand All @@ -22,7 +22,7 @@ public HomeController()

public HomeController(IConfigurationRepository configuration)
{
ConfigurationRepository = configuration;
Configuration = configuration;
}

public ActionResult Index()
Expand All @@ -35,25 +35,67 @@ public ActionResult AppIntegration()
var endpoints = Endpoints.Create(
HttpContext.Request.Headers["Host"],
HttpContext.Request.ApplicationPath,
ConfigurationRepository.Global.HttpPort,
ConfigurationRepository.Global.HttpsPort);
Configuration.Global.HttpPort,
Configuration.Global.HttpsPort);

var list = new Dictionary<string, string>
var list = new Dictionary<string, string>();

// federation metadata
if (Configuration.FederationMetadata.Enabled)
{
list.Add("WS-Federation metadata", endpoints.WSFederation.AbsoluteUri);
}

// ws-federation
if (Configuration.WSFederation.Enabled)
{
if (Configuration.WSFederation.EnableAuthentication)
{
list.Add("WS-Federation", endpoints.WSFederation.AbsoluteUri);
}
if (Configuration.WSFederation.EnableFederation)
{
list.Add("WS-Federation HRD", endpoints.WSFederationHRD.AbsoluteUri);
}
}

// ws-trust
if (Configuration.WSTrust.Enabled)
{
list.Add("WS-Trust metadata", endpoints.WSTrustMex.AbsoluteUri);

if (Configuration.WSTrust.EnableMessageSecurity)
{
list.Add("WS-Trust message security (user name)", endpoints.WSTrustMessageUserName.AbsoluteUri);

if (Configuration.WSTrust.EnableClientCertificateAuthentication)
{
list.Add("WS-Trust message security (client certificate)", endpoints.WSTrustMessageCertificate.AbsoluteUri);
}
}

if (Configuration.WSTrust.EnableMixedModeSecurity)
{
list.Add("WS-Trust mixed mode security (user name)", endpoints.WSTrustMixedUserName.AbsoluteUri);

if (Configuration.WSTrust.EnableClientCertificateAuthentication)
{
list.Add("WS-Trust mixed mode security (client certificate)", endpoints.WSTrustMixedCertificate.AbsoluteUri);
}
}
}

// oauth2
if (Configuration.OAuth2.Enabled)
{
list.Add("OAuth2", endpoints.OAuth2.AbsoluteUri);
}

// simple http
if (Configuration.SimpleHttp.Enabled)
{
{ "WS-Federation", endpoints.WSFederation.AbsoluteUri },
{ "WS-Federation metadata", endpoints.WSFederationMetadata.AbsoluteUri },

{ "WS-Trust mixed (UserName)", endpoints.WSTrustMixedUserName.AbsoluteUri },
{ "WS-Trust mixed (Certificate)", endpoints.WSTrustMixedCertificate.AbsoluteUri },
{ "WS-Trust message (UserName)", endpoints.WSTrustMessageUserName.AbsoluteUri },
{ "WS-Trust message (Certificate)", endpoints.WSTrustMessageCertificate.AbsoluteUri },
{ "WS-Trust metadata", endpoints.WSTrustMex.AbsoluteUri },

{ "WRAP", endpoints.Wrap.AbsoluteUri },
{ "OAuth2", endpoints.OAuth2.AbsoluteUri },
{ "JSNotify", endpoints.JSNotify.AbsoluteUri },
{ "Simple HTTP", endpoints.SimpleHttp.AbsoluteUri },
};
list.Add("Simple HTTP", endpoints.SimpleHttp.AbsoluteUri);
}

return View(list);
}
Expand Down

0 comments on commit 07112b1

Please sign in to comment.