Skip to content

Commit

Permalink
Rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersAbel committed Jan 12, 2018
1 parent c56959e commit 9b75409
Show file tree
Hide file tree
Showing 201 changed files with 3,598 additions and 3,596 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ nuget/*nupkg

*.nuspec
!/nuget/*.nuspec
Kentor.AuthServices.StubIdp/App_Data/*.json
Sustainsys.Saml2.StubIdp/App_Data/*.json

#Ndepend Stuff
*.ndproj
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for keeping application specific user and role information. See the

## Stub Idp
The solution also contains a stub (i.e. dummy) identity provider that can be used for testing.
Download the solution, or use the instance that's provided for free at http://stubidp.Sustainsys.se.
Download the solution, or use the instance that's provided for free at http://stubidp.Kentor.se.

## Protocol Classes
The protocol handling classes are available as a public API as well, making it possible to
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@
<Content Include="Views\Home\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Kentor.AuthServices.HttpModule\Kentor.AuthServices.HttpModule.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2.HttpModule\Sustainsys.Saml2.HttpModule.csproj">
<Project>{86a588e8-2e2d-4394-9545-24d8ea939cf2}</Project>
<Name>Kentor.AuthServices.HttpModule</Name>
<Name>Sustainsys.Saml2.HttpModule</Name>
</ProjectReference>
<ProjectReference Include="..\..\Kentor.AuthServices\Kentor.AuthServices.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2\Sustainsys.Saml2.csproj">
<Project>{93ba675e-a159-4701-b68b-c4b81015c556}</Project>
<Name>Kentor.AuthServices</Name>
<Name>Sustainsys.Saml2</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Kentor.AuthServices.StubIdp.cer" />
<Content Include="App_Data\Sustainsys.Saml2.StubIdp.cer" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Kentor.AuthServices.Tests.pfx">
<Content Include="App_Data\Sustainsys.Saml2.Tests.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/SampleHttpModuleApplication/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<nameIdPolicy allowCreate="true" format="Persistent" />
<requestedAuthnContext classRef="Password" comparison="Minimum" />
<identityProviders>
<add entityId="http://stubidp.Sustainsys.se/Metadata" signOnUrl="http://stubidp.Sustainsys.se/" allowUnsolicitedAuthnResponse="true" binding="HttpRedirect">
<signingCertificate fileName="~/App_Data/Sustainsys.Saml2.StubIdp.cer" />
<add entityId="http://stubidp.Kentor.se/Metadata" signOnUrl="http://stubidp.Kentor.se/" allowUnsolicitedAuthnResponse="true" binding="HttpRedirect">
<signingCertificate fileName="~/App_Data/Kentor.AuthServices.StubIdp.cer" />
</add>
</identityProviders>
<federations>
Expand Down
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions Samples/SampleIdentityServer3/SampleIdentityServer3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Kentor.AuthServices.SampleIdentityServer3.pfx" />
<Content Include="App_Data\Sustainsys.Saml2.SampleIdentityServer3.pfx" />
<None Include="index.cshtml" />
<Content Include="check_session.html" />
<Content Include="oidc-token-manager.js" />
<Content Include="packages.config" />
<Content Include="App_Data\Kentor.AuthServices.Tests.pfx">
<Content Include="App_Data\Sustainsys.Saml2.Tests.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Web.Debug.config">
Expand All @@ -161,13 +161,13 @@
<Compile Include="Users.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Kentor.AuthServices.Owin\Kentor.AuthServices.Owin.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2.Owin\Sustainsys.Saml2.Owin.csproj">
<Project>{fa1e7723-124c-4d2d-a731-e16400b0073b}</Project>
<Name>Kentor.AuthServices.Owin</Name>
<Name>Sustainsys.Saml2.Owin</Name>
</ProjectReference>
<ProjectReference Include="..\..\Kentor.AuthServices\Kentor.AuthServices.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2\Sustainsys.Saml2.csproj">
<Project>{93ba675e-a159-4701-b68b-c4b81015c556}</Project>
<Name>Kentor.AuthServices</Name>
<Name>Sustainsys.Saml2</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
Expand Down
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions Samples/SampleMvcApplication/SampleMvcApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
<Content Include="fonts\glyphicons-halflings-regular.eot" />
<Content Include="Content\bootstrap-theme.css.map" />
<Content Include="Content\bootstrap.css.map" />
<Content Include="App_Data\Kentor.AuthServices.StubIdp.cer" />
<Content Include="App_Data\Kentor.AuthServices.Tests.pfx" />
<Content Include="App_Data\Sustainsys.Saml2.StubIdp.cer" />
<Content Include="App_Data\Sustainsys.Saml2.Tests.pfx" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
<Content Include="Scripts\jquery-2.1.1.js" />
Expand All @@ -156,9 +156,9 @@
<Content Include="Scripts\jquery-2.1.1.min.map" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Kentor.AuthServices.Mvc\Kentor.AuthServices.Mvc.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2.Mvc\Sustainsys.Saml2.Mvc.csproj">
<Project>{7d32f0a3-cec8-4dc6-a096-5905ea9c3770}</Project>
<Name>Kentor.AuthServices.Mvc</Name>
<Name>Sustainsys.Saml2.Mvc</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Samples/SampleMvcApplication/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
</system.webServer>
<Sustainsys.Saml2 entityId="http://localhost:2181/Saml2" returnUrl="http://localhost:2181/" discoveryServiceUrl="http://localhost:52071/DiscoveryService">
<identityProviders>
<add entityId="http://stubidp.Sustainsys.se/Metadata"
signOnUrl="http://stubidp.Sustainsys.se/"
<add entityId="http://stubidp.Kentor.se/Metadata"
signOnUrl="http://stubidp.Kentor.se/"
allowUnsolicitedAuthnResponse="true" binding="HttpRedirect">
<signingCertificate fileName="~/App_Data/Sustainsys.Saml2.StubIdp.cer" />
<signingCertificate fileName="~/App_Data/Kentor.AuthServices.StubIdp.cer" />
</add>
</identityProviders>
<federations>
Expand Down
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions Samples/SampleOwinApplication/App_Start/Startup.Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ private static SustainsysSaml2AuthenticationOptions CreateSaml2Options()
SPOptions = spOptions
};

var idp = new IdentityProvider(new EntityId("http://stubidp.Sustainsys.se/Metadata"), spOptions)
var idp = new IdentityProvider(new EntityId("http://stubidp.Kentor.se/Metadata"), spOptions)
{
AllowUnsolicitedAuthnResponse = true,
Binding = Saml2BindingType.HttpRedirect,
SingleSignOnServiceUrl = new Uri("http://stubidp.Sustainsys.se")
SingleSignOnServiceUrl = new Uri("http://stubidp.Kentor.se")
};

idp.SigningKeys.AddConfiguredKey(
new X509Certificate2(
HostingEnvironment.MapPath(
"~/App_Data/Sustainsys.Saml2.StubIdp.cer")));
"~/App_Data/Kentor.AuthServices.StubIdp.cer")));

Saml2Options.IdentityProviders.Add(idp);

Expand Down
12 changes: 6 additions & 6 deletions Samples/SampleOwinApplication/SampleOwinApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@
<Content Include="fonts\glyphicons-halflings-regular.eot" />
<Content Include="Content\bootstrap-theme.css.map" />
<Content Include="Content\bootstrap.css.map" />
<Content Include="App_Data\Kentor.AuthServices.StubIdp.cer" />
<Content Include="App_Data\Kentor.AuthServices.Tests.pfx" />
<Content Include="App_Data\Sustainsys.Saml2.StubIdp.cer" />
<Content Include="App_Data\Sustainsys.Saml2.Tests.pfx" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
<Content Include="Scripts\jquery-2.1.1.js" />
Expand Down Expand Up @@ -278,13 +278,13 @@
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Kentor.AuthServices.Owin\Kentor.AuthServices.Owin.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2.Owin\Sustainsys.Saml2.Owin.csproj">
<Project>{fa1e7723-124c-4d2d-a731-e16400b0073b}</Project>
<Name>Kentor.AuthServices.Owin</Name>
<Name>Sustainsys.Saml2.Owin</Name>
</ProjectReference>
<ProjectReference Include="..\..\Kentor.AuthServices\Kentor.AuthServices.csproj">
<ProjectReference Include="..\..\Sustainsys.Saml2\Sustainsys.Saml2.csproj">
<Project>{93ba675e-a159-4701-b68b-c4b81015c556}</Project>
<Name>Kentor.AuthServices</Name>
<Name>Sustainsys.Saml2</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Kentor.AuthServices\Kentor.AuthServices.csproj">
<ProjectReference Include="..\Sustainsys.Saml2\Sustainsys.Saml2.csproj">
<Project>{93BA675E-A159-4701-B68B-C4B81015C556}</Project>
<Name>Kentor.AuthServices</Name>
</ProjectReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
using Sustainsys.Saml2.Configuration;
using Sustainsys.Saml2.WebSso;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Web;

namespace Sustainsys.Saml2.HttpModule
{
/// <summary>
/// Http Module for SAML2 authentication. The module hijacks the
/// ~/Saml2AuthenticationModule/ path of the http application to provide
/// authentication services.
/// </summary>
// Not included in code coverage as the http module is tightly dependent on IIS.
[ExcludeFromCodeCoverage]
public class Saml2AuthenticationModule : IHttpModule
{
/// <summary>
/// The one and only options instance used by the
/// <see cref="Saml2AuthenticationModule"/>. It is instantiated by
/// loading the web.config, but after that it can be modified or even
/// replaced from code.
/// </summary>
public static IOptions Options { get; set; } = Configuration.Options.FromConfiguration;

/// <summary>
/// Init the module and subscribe to events.
/// </summary>
/// <param name="context"></param>
public void Init(HttpApplication context)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}

// Run our code post authentication to allow any session authentication
// to be done first (required by logout) but still execute as close
// as possible to the normal authentication step.
context.AuthenticateRequest += OnAuthenticateRequest;
}

/// <summary>
/// Begin request handler that captures all traffic to configured module
/// path.
/// </summary>
/// <param name="sender">The http application.</param>
/// <param name="e">Ignored</param>
protected void OnAuthenticateRequest(object sender, EventArgs e)
{
var application = (HttpApplication)sender;

// Strip the leading ~ from the AppRelative path.
var appRelativePath = application.Request.AppRelativeCurrentExecutionFilePath;
appRelativePath = (!string.IsNullOrEmpty(appRelativePath))
? appRelativePath.Substring(1)
: string.Empty;

var modulePath = Options.SPOptions.ModulePath;

if (appRelativePath.StartsWith(modulePath, StringComparison.OrdinalIgnoreCase))
{
var commandName = appRelativePath.Substring(modulePath.Length);

var command = CommandFactory.GetCommand(commandName);
var commandResult = command.Run(
new HttpRequestWrapper(application.Request).ToHttpRequestData(),
Options);

if (!commandResult.HandledResult)
{
commandResult.SignInOrOutSessionAuthenticationModule();
commandResult.Apply(new HttpResponseWrapper(application.Response));
}
}
}

/// <summary>
/// IDisposable implementation.
/// </summary>
public virtual void Dispose()
{
// Deliberately do nothing, unsubscribing from events is not
// needed by the IIS model. Trying to do so throws exceptions.
}
}
}
using Sustainsys.Saml2.Configuration;
using Sustainsys.Saml2.WebSso;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Web;

namespace Sustainsys.Saml2.HttpModule
{
/// <summary>
/// Http Module for SAML2 authentication. The module hijacks the
/// ~/Saml2AuthenticationModule/ path of the http application to provide
/// authentication services.
/// </summary>
// Not included in code coverage as the http module is tightly dependent on IIS.
[ExcludeFromCodeCoverage]
public class Saml2AuthenticationModule : IHttpModule
{
/// <summary>
/// The one and only options instance used by the
/// <see cref="Saml2AuthenticationModule"/>. It is instantiated by
/// loading the web.config, but after that it can be modified or even
/// replaced from code.
/// </summary>
public static IOptions Options { get; set; } = Configuration.Options.FromConfiguration;

/// <summary>
/// Init the module and subscribe to events.
/// </summary>
/// <param name="context"></param>
public void Init(HttpApplication context)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}

// Run our code post authentication to allow any session authentication
// to be done first (required by logout) but still execute as close
// as possible to the normal authentication step.
context.AuthenticateRequest += OnAuthenticateRequest;
}

/// <summary>
/// Begin request handler that captures all traffic to configured module
/// path.
/// </summary>
/// <param name="sender">The http application.</param>
/// <param name="e">Ignored</param>
protected void OnAuthenticateRequest(object sender, EventArgs e)
{
var application = (HttpApplication)sender;

// Strip the leading ~ from the AppRelative path.
var appRelativePath = application.Request.AppRelativeCurrentExecutionFilePath;
appRelativePath = (!string.IsNullOrEmpty(appRelativePath))
? appRelativePath.Substring(1)
: string.Empty;

var modulePath = Options.SPOptions.ModulePath;

if (appRelativePath.StartsWith(modulePath, StringComparison.OrdinalIgnoreCase))
{
var commandName = appRelativePath.Substring(modulePath.Length);

var command = CommandFactory.GetCommand(commandName);
var commandResult = command.Run(
new HttpRequestWrapper(application.Request).ToHttpRequestData(),
Options);

if (!commandResult.HandledResult)
{
commandResult.SignInOrOutSessionAuthenticationModule();
commandResult.Apply(new HttpResponseWrapper(application.Response));
}
}
}

/// <summary>
/// IDisposable implementation.
/// </summary>
public virtual void Dispose()
{
// Deliberately do nothing, unsubscribing from events is not
// needed by the IIS model. Trying to do so throws exceptions.
}
}
}
Loading

0 comments on commit 9b75409

Please sign in to comment.