Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit 9550cab

Browse files
committed
Reunify the OWIN/Katana and ASP.NET Core projects in the same branch
1 parent 5363973 commit 9550cab

27 files changed

Lines changed: 1745 additions & 15 deletions
Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
4+
VisualStudioVersion = 14.0.24720.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7AADF737-9B13-4E5C-8F32-8BF21429E093}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2B1B08E0-E9A3-40C0-B200-DE09952AF0E7}"
99
EndProject
10-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Introspection", "src\Owin.Security.OAuth.Introspection\Owin.Security.OAuth.Introspection.xproj", "{A8569260-142C-427A-8B14-A8DF56CC15B7}"
10+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AspNet.Security.OAuth.Introspection", "src\AspNet.Security.OAuth.Introspection\AspNet.Security.OAuth.Introspection.xproj", "{A8569260-142C-427A-8B14-A8DF56CC15B7}"
1111
EndProject
12-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Introspection.Tests", "test\Owin.Security.OAuth.Introspection.Tests\Owin.Security.OAuth.Introspection.Tests.xproj", "{4070DC46-0FD5-4ADD-95B3-E9908AD82407}"
12+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AspNet.Security.OAuth.Introspection.Tests", "test\AspNet.Security.OAuth.Introspection.Tests\AspNet.Security.OAuth.Introspection.Tests.xproj", "{4070DC46-0FD5-4ADD-95B3-E9908AD82407}"
1313
EndProject
14-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Validation", "src\Owin.Security.OAuth.Validation\Owin.Security.OAuth.Validation.xproj", "{043FD757-9C69-4A68-93BF-EAD2672BBD78}"
14+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AspNet.Security.OAuth.Validation", "src\AspNet.Security.OAuth.Validation\AspNet.Security.OAuth.Validation.xproj", "{043FD757-9C69-4A68-93BF-EAD2672BBD78}"
1515
EndProject
16-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Validation.Tests", "test\Owin.Security.OAuth.Validation.Tests\Owin.Security.OAuth.Validation.Tests.xproj", "{FC99E58D-86BC-4EAD-B282-C9F1491CCF96}"
16+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AspNet.Security.OAuth.Validation.Tests", "test\AspNet.Security.OAuth.Validation.Tests\AspNet.Security.OAuth.Validation.Tests.xproj", "{FC99E58D-86BC-4EAD-B282-C9F1491CCF96}"
17+
EndProject
18+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Introspection", "src\Owin.Security.OAuth.Introspection\Owin.Security.OAuth.Introspection.xproj", "{F9031F69-74BF-4321-88D5-2A606D3DA4E4}"
19+
EndProject
20+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Introspection.Tests", "test\Owin.Security.OAuth.Introspection.Tests\Owin.Security.OAuth.Introspection.Tests.xproj", "{A6B08CB3-0B3E-444D-BCF1-E9E41CEEC984}"
21+
EndProject
22+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Validation", "src\Owin.Security.OAuth.Validation\Owin.Security.OAuth.Validation.xproj", "{719AF040-773B-4DA5-B53E-28B26D1121FF}"
23+
EndProject
24+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Owin.Security.OAuth.Validation.Tests", "test\Owin.Security.OAuth.Validation.Tests\Owin.Security.OAuth.Validation.Tests.xproj", "{6DC60DCF-B34B-4F14-9E73-BE466059A9B2}"
1725
EndProject
1826
Global
1927
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -37,6 +45,22 @@ Global
3745
{FC99E58D-86BC-4EAD-B282-C9F1491CCF96}.Debug|Any CPU.Build.0 = Debug|Any CPU
3846
{FC99E58D-86BC-4EAD-B282-C9F1491CCF96}.Release|Any CPU.ActiveCfg = Release|Any CPU
3947
{FC99E58D-86BC-4EAD-B282-C9F1491CCF96}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{F9031F69-74BF-4321-88D5-2A606D3DA4E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{F9031F69-74BF-4321-88D5-2A606D3DA4E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{F9031F69-74BF-4321-88D5-2A606D3DA4E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{F9031F69-74BF-4321-88D5-2A606D3DA4E4}.Release|Any CPU.Build.0 = Release|Any CPU
52+
{A6B08CB3-0B3E-444D-BCF1-E9E41CEEC984}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53+
{A6B08CB3-0B3E-444D-BCF1-E9E41CEEC984}.Debug|Any CPU.Build.0 = Debug|Any CPU
54+
{A6B08CB3-0B3E-444D-BCF1-E9E41CEEC984}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{A6B08CB3-0B3E-444D-BCF1-E9E41CEEC984}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{719AF040-773B-4DA5-B53E-28B26D1121FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{719AF040-773B-4DA5-B53E-28B26D1121FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{719AF040-773B-4DA5-B53E-28B26D1121FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
59+
{719AF040-773B-4DA5-B53E-28B26D1121FF}.Release|Any CPU.Build.0 = Release|Any CPU
60+
{6DC60DCF-B34B-4F14-9E73-BE466059A9B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61+
{6DC60DCF-B34B-4F14-9E73-BE466059A9B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
62+
{6DC60DCF-B34B-4F14-9E73-BE466059A9B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
63+
{6DC60DCF-B34B-4F14-9E73-BE466059A9B2}.Release|Any CPU.Build.0 = Release|Any CPU
4064
EndGlobalSection
4165
GlobalSection(SolutionProperties) = preSolution
4266
HideSolutionNode = FALSE
@@ -46,5 +70,9 @@ Global
4670
{4070DC46-0FD5-4ADD-95B3-E9908AD82407} = {2B1B08E0-E9A3-40C0-B200-DE09952AF0E7}
4771
{043FD757-9C69-4A68-93BF-EAD2672BBD78} = {7AADF737-9B13-4E5C-8F32-8BF21429E093}
4872
{FC99E58D-86BC-4EAD-B282-C9F1491CCF96} = {2B1B08E0-E9A3-40C0-B200-DE09952AF0E7}
73+
{F9031F69-74BF-4321-88D5-2A606D3DA4E4} = {7AADF737-9B13-4E5C-8F32-8BF21429E093}
74+
{A6B08CB3-0B3E-444D-BCF1-E9E41CEEC984} = {2B1B08E0-E9A3-40C0-B200-DE09952AF0E7}
75+
{719AF040-773B-4DA5-B53E-28B26D1121FF} = {7AADF737-9B13-4E5C-8F32-8BF21429E093}
76+
{6DC60DCF-B34B-4F14-9E73-BE466059A9B2} = {2B1B08E0-E9A3-40C0-B200-DE09952AF0E7}
4977
EndGlobalSection
5078
EndGlobal
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>a8569260-142c-427a-8b14-a8df56cc15b7</ProjectGuid>
11+
<RootNamespace>AspNet.Security.OpenIdConnect.Introspection</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
14+
</PropertyGroup>
15+
16+
<PropertyGroup>
17+
<SchemaVersion>2.0</SchemaVersion>
18+
</PropertyGroup>
19+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
20+
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
3+
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions for more information
4+
* concerning the license and the contributors participating to this project.
5+
*/
6+
7+
namespace AspNet.Security.OAuth.Introspection {
8+
public static class OAuthIntrospectionConstants {
9+
public static class Claims {
10+
public const string Active = "active";
11+
public const string Audience = "aud";
12+
public const string ExpiresAt = "exp";
13+
public const string IssuedAt = "iat";
14+
public const string NotBefore = "nbf";
15+
public const string Scope = "scope";
16+
public const string Subject = "sub";
17+
public const string TokenType = "token_type";
18+
public const string Username = "username";
19+
}
20+
21+
public static class Metadata {
22+
public const string IntrospectionEndpoint = "introspection_endpoint";
23+
}
24+
25+
public static class Parameters {
26+
public const string Token = "token";
27+
public const string TokenTypeHint = "token_type_hint";
28+
}
29+
30+
public static class TokenTypes {
31+
public const string AccessToken = "access_token";
32+
}
33+
}
34+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
3+
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions for more information
4+
* concerning the license and the contributors participating to this project.
5+
*/
6+
7+
namespace AspNet.Security.OAuth.Introspection {
8+
public static class OAuthIntrospectionDefaults {
9+
/// <summary>
10+
/// Gets the default scheme used by the introspection middleware.
11+
/// </summary>
12+
public const string AuthenticationScheme = "Bearer";
13+
}
14+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
3+
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions for more information
4+
* concerning the license and the contributors participating to this project.
5+
*/
6+
7+
using System;
8+
using AspNet.Security.OAuth.Introspection;
9+
using JetBrains.Annotations;
10+
using Microsoft.Extensions.Options;
11+
12+
namespace Microsoft.AspNetCore.Builder {
13+
/// <summary>
14+
/// Provides extension methods used to configure the OAuth2
15+
/// introspection middleware in an ASP.NET 5 pipeline.
16+
/// </summary>
17+
public static class OAuthIntrospectionExtensions {
18+
/// <summary>
19+
/// Adds a new instance of the OAuth2 introspection middleware in the ASP.NET 5 pipeline.
20+
/// </summary>
21+
/// <param name="app">The application builder.</param>
22+
/// <param name="configuration">The delegate used to configure the introspection options.</param>
23+
/// <returns>The application builder.</returns>
24+
public static IApplicationBuilder UseOAuthIntrospection(
25+
[NotNull] this IApplicationBuilder app,
26+
[NotNull] Action<OAuthIntrospectionOptions> configuration) {
27+
if (app == null) {
28+
throw new ArgumentNullException(nameof(app));
29+
}
30+
31+
if (configuration == null) {
32+
throw new ArgumentNullException(nameof(configuration));
33+
}
34+
35+
var options = new OAuthIntrospectionOptions();
36+
configuration(options);
37+
38+
return app.UseOAuthIntrospection(options);
39+
}
40+
41+
/// <summary>
42+
/// Adds a new instance of the OAuth2 introspection middleware in the ASP.NET 5 pipeline.
43+
/// </summary>
44+
/// <param name="app">The application builder.</param>
45+
/// <param name="options">The options used to configure the introspection middleware.</param>
46+
/// <returns>The application builder.</returns>
47+
public static IApplicationBuilder UseOAuthIntrospection(
48+
[NotNull] this IApplicationBuilder app,
49+
[NotNull] OAuthIntrospectionOptions options) {
50+
if (app == null) {
51+
throw new ArgumentNullException(nameof(app));
52+
}
53+
54+
if (options == null) {
55+
throw new ArgumentNullException(nameof(options));
56+
}
57+
58+
return app.UseMiddleware<OAuthIntrospectionMiddleware>(Options.Create(options));
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)