This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for SameSite cookies and other security relevant updates
- Loading branch information
1 parent
e6024dd
commit 5456fe2
Showing
50 changed files
with
76,977 additions
and
25 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
SameSite Fix/sample/IdentityServerHost/IdentityServerHost.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29613.14 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServerHost", "IdentityServerHost\IdentityServerHost.csproj", "{03D49418-1F96-4211-A798-064AB9405D36}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{03D49418-1F96-4211-A798-064AB9405D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{03D49418-1F96-4211-A798-064AB9405D36}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{03D49418-1F96-4211-A798-064AB9405D36}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{03D49418-1F96-4211-A798-064AB9405D36}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {FD779A39-D070-453F-956C-EEA0BCAD29A1} | ||
EndGlobalSection | ||
EndGlobal |
47 changes: 47 additions & 0 deletions
47
SameSite Fix/sample/IdentityServerHost/IdentityServerHost/Config/Cert.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2014 Dominick Baier, Brock Allen | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using System.IO; | ||
using System.Security.Cryptography.X509Certificates; | ||
|
||
namespace IdentityServerHost.Config | ||
{ | ||
public class Cert | ||
{ | ||
public static X509Certificate2 Load() | ||
{ | ||
var assembly = typeof(Cert).Assembly; | ||
using (var stream = assembly.GetManifestResourceStream("IdentityServerHost.Config.idsrv3test.pfx")) | ||
{ | ||
return new X509Certificate2(ReadStream(stream), "idsrv3test"); | ||
} | ||
} | ||
|
||
private static byte[] ReadStream(Stream input) | ||
{ | ||
var buffer = new byte[16 * 1024]; | ||
using (var ms = new MemoryStream()) | ||
{ | ||
int read; | ||
while ((read = input.Read(buffer, 0, buffer.Length)) > 0) | ||
{ | ||
ms.Write(buffer, 0, read); | ||
} | ||
return ms.ToArray(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.