Skip to content

Commit 97c372e

Browse files
committed
VS 2017. Core 1.1 updated to 2.0
1 parent 6f4548f commit 97c372e

25 files changed

+142
-386
lines changed

ITfoxtec.Identity.Saml2.sln

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27004.2002
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A05F26DE-17C2-497F-B244-EE6790789066}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{80F86A4F-9009-4FB4-9E92-33B6513CF2D7}"
9-
ProjectSection(SolutionItems) = preProject
10-
global.json = global.json
11-
EndProjectSection
129
EndProject
1310
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DE5976C5-83CD-4518-A05E-0DEC2EA5D17C}"
1411
EndProject
1512
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ITfoxtec.Identity.Saml2", "src\ITfoxtec.Identity.Saml2\ITfoxtec.Identity.Saml2.csproj", "{BB8FE53F-B198-4DCF-B51C-B11CC0215AE7}"
1613
EndProject
17-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ITfoxtec.Identity.Saml2.MvcCore", "src\ITfoxtec.Identity.Saml2.MvcCore\ITfoxtec.Identity.Saml2.MvcCore.xproj", "{FA372444-40AE-4F9E-97A3-6A3DC7B719E0}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITfoxtec.Identity.Saml2.MvcCore", "src\ITfoxtec.Identity.Saml2.MvcCore\ITfoxtec.Identity.Saml2.MvcCore.csproj", "{FA372444-40AE-4F9E-97A3-6A3DC7B719E0}"
1815
EndProject
19-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestWebAppCore", "test\TestWebAppCore\TestWebAppCore.xproj", "{4C3E929B-D5AA-45EA-8945-97C0C7E3309D}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWebAppCore", "test\TestWebAppCore\TestWebAppCore.csproj", "{4C3E929B-D5AA-45EA-8945-97C0C7E3309D}"
2017
EndProject
2118
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ITfoxtec.Identity.Saml2.Mvc", "src\ITfoxtec.Identity.Saml2.Mvc\ITfoxtec.Identity.Saml2.Mvc.csproj", "{DA5D0686-F694-4667-8CF9-CCF1B9BB1626}"
2219
EndProject
23-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestIdPCore", "test\TestIdPCore\TestIdPCore.xproj", "{732D6B51-DF98-48E6-96AC-E16FED8FB3CE}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestIdPCore", "test\TestIdPCore\TestIdPCore.csproj", "{732D6B51-DF98-48E6-96AC-E16FED8FB3CE}"
2421
EndProject
2522
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWebApp", "test\TestWebApp\TestWebApp.csproj", "{9FEC1868-DF03-43B2-8AB9-DBE5F4E223D2}"
2623
EndProject
@@ -66,4 +63,7 @@ Global
6663
{732D6B51-DF98-48E6-96AC-E16FED8FB3CE} = {DE5976C5-83CD-4518-A05E-0DEC2EA5D17C}
6764
{9FEC1868-DF03-43B2-8AB9-DBE5F4E223D2} = {DE5976C5-83CD-4518-A05E-0DEC2EA5D17C}
6865
EndGlobalSection
66+
GlobalSection(ExtensibilityGlobals) = postSolution
67+
SolutionGuid = {64BB7D39-E92F-466D-B601-276E16FF6EB4}
68+
EndGlobalSection
6969
EndGlobal

global.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/ITfoxtec.Identity.Saml2.MvcCore/Configuration/Saml2ApplicationBuilderCollectionExtensions.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using ITfoxtec.Identity.Saml2.Schemas;
2-
using Microsoft.AspNetCore.Builder;
3-
using Microsoft.AspNetCore.Http;
1+
using Microsoft.AspNetCore.Builder;
42

53
namespace ITfoxtec.Identity.Saml2.MvcCore.Configuration
64
{
@@ -11,13 +9,7 @@ public static class Saml2ApplicationBuilderCollectionExtensions
119
/// </summary>
1210
public static IApplicationBuilder UseSaml2(this IApplicationBuilder app)
1311
{
14-
app.UseCookieAuthentication(new CookieAuthenticationOptions
15-
{
16-
AuthenticationScheme = Saml2Constants.AuthenticationScheme,
17-
AutomaticAuthenticate = true,
18-
AutomaticChallenge = true,
19-
LoginPath = new PathString("/Auth/Login"),
20-
});
12+
app.UseAuthentication();
2113

2214
return app;
2315
}
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using ITfoxtec.Identity.Saml2.Cryptography;
2-
using Microsoft.Extensions.DependencyInjection;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Threading.Tasks;
1+
using Microsoft.Extensions.DependencyInjection;
2+
using Microsoft.AspNetCore.Http;
3+
using ITfoxtec.Identity.Saml2.Schemas;
74

85
namespace ITfoxtec.Identity.Saml2.MvcCore.Configuration
96
{
@@ -16,7 +13,13 @@ public static IServiceCollection AddSaml2(this IServiceCollection services, Saml
1613
{
1714
services.AddSingleton(configuration);
1815

16+
services.AddAuthentication(Saml2Constants.AuthenticationScheme)
17+
.AddCookie(Saml2Constants.AuthenticationScheme, o =>
18+
{
19+
o.LoginPath = new PathString("/Auth/Login");
20+
});
21+
1922
return services;
20-
}
23+
}
2124
}
2225
}

src/ITfoxtec.Identity.Saml2.MvcCore/Extensions/Saml2BindingExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Microsoft.AspNetCore.Mvc;
2-
using Microsoft.Net.Http.Headers;
32

43
namespace ITfoxtec.Identity.Saml2.MvcCore
54
{

src/ITfoxtec.Identity.Saml2.MvcCore/Extensions/Saml2RequestExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using ITfoxtec.Identity.Saml2.Schemas;
22
using Microsoft.AspNetCore.Http;
33
using System.Threading.Tasks;
4+
using Microsoft.AspNetCore.Authentication;
45

56
namespace ITfoxtec.Identity.Saml2.MvcCore
67
{
@@ -11,7 +12,7 @@ public static class Saml2RequestExtensions
1112
/// </summary>
1213
public static async Task<Saml2LogoutRequest> DeleteSession(this Saml2LogoutRequest saml2LogoutRequest, HttpContext httpContext)
1314
{
14-
await httpContext.Authentication.SignOutAsync(Saml2Constants.AuthenticationScheme);
15+
await httpContext.SignOutAsync(Saml2Constants.AuthenticationScheme);
1516
return saml2LogoutRequest;
1617
}
1718
}

src/ITfoxtec.Identity.Saml2.MvcCore/Extensions/Saml2ResponseExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using ITfoxtec.Identity.Saml2.Schemas;
2-
using Microsoft.AspNetCore.Http;
3-
using Microsoft.AspNetCore.Http.Authentication;
42
using System;
53
using System.Security.Claims;
64
using System.Threading;
75
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Authentication;
7+
using Microsoft.AspNetCore.Http;
88

99
namespace ITfoxtec.Identity.Saml2.MvcCore
1010
{
@@ -34,12 +34,12 @@ public static async Task<ClaimsPrincipal> CreateSession(this Saml2AuthnResponse
3434
throw new InvalidOperationException("No Claims Identity created from SAML2 Response.");
3535
}
3636

37-
if (claimsTransform != null)
37+
if(claimsTransform != null)
3838
{
3939
principal = claimsTransform(principal);
4040
}
4141

42-
await httpContext.Authentication.SignInAsync(Saml2Constants.AuthenticationScheme, principal,
42+
await httpContext.SignInAsync(Saml2Constants.AuthenticationScheme, principal,
4343
new AuthenticationProperties
4444
{
4545
AllowRefresh = false,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<AssemblyTitle>ITfoxtec.Identity.Saml2.MvcCore</AssemblyTitle>
5+
<VersionPrefix>2.0.0.0</VersionPrefix>
6+
<TargetFramework>net461</TargetFramework>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<AssemblyName>ITfoxtec.Identity.Saml2.MvcCore</AssemblyName>
9+
<PackageId>ITfoxtec.Identity.Saml2.MvcCore</PackageId>
10+
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
11+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
12+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\ITfoxtec.Identity.Saml2\ITfoxtec.Identity.Saml2.csproj" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
21+
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.0" />
22+
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" />
23+
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0" />
24+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.0.0" />
25+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.0" />
26+
</ItemGroup>
27+
28+
</Project>

src/ITfoxtec.Identity.Saml2.MvcCore/ITfoxtec.Identity.Saml2.MvcCore.xproj

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/ITfoxtec.Identity.Saml2.MvcCore/project.fragment.lock.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)