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

Commit bd41e8e

Browse files
committed
Incorporate the changes committed in the release branch
2 parents cf9c0fc + 553a3fe commit bd41e8e

File tree

11 files changed

+123
-133
lines changed

11 files changed

+123
-133
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ AspNet.Security.OAuth.Extensions
55

66
**The latest nightly builds can be found on [MyGet](https://www.myget.org/gallery/aspnet-contrib)**.
77

8-
[![Build status](https://ci.appveyor.com/api/projects/status/aa7t5nfxpiri1e85/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnet-contrib/aspnet-security-oauth-extensions/branch/dev)
9-
[![Build status](https://travis-ci.org/aspnet-contrib/AspNet.Security.OAuth.Extensions.svg?branch=dev)](https://travis-ci.org/aspnet-contrib/AspNet.Security.OAuth.Extensions)
8+
[![Build status](https://ci.appveyor.com/api/projects/status/aa7t5nfxpiri1e85/branch/release?svg=true)](https://ci.appveyor.com/project/aspnet-contrib/aspnet-security-oauth-extensions/branch/release)
9+
[![Build status](https://travis-ci.org/aspnet-contrib/AspNet.Security.OAuth.Extensions.svg?branch=release)](https://travis-ci.org/aspnet-contrib/AspNet.Security.OAuth.Extensions)
1010

1111
## Get started
1212

src/AspNet.Security.OAuth.Introspection/project.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
{
22
"version": "1.0.0-alpha2-*",
33

4-
"description": "OAuth2 introspection middleware for ASP.NET Core.",
5-
"authors": [ "Kévin Chalet" ],
6-
"owners": [ "Kévin Chalet" ],
7-
8-
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
9-
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
10-
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
4+
"packOptions": {
5+
"description": "OAuth2 introspection middleware for ASP.NET Core.",
6+
"authors": [ "Kévin Chalet" ],
7+
"owners": [ "Kévin Chalet" ],
8+
9+
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
10+
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
11+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
12+
13+
"repository": {
14+
"type": "git",
15+
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
16+
},
1117

12-
"repository": {
13-
"type": "git",
14-
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
18+
"tags": [
19+
"aspnetcore",
20+
"authentication",
21+
"jwt",
22+
"openidconnect",
23+
"security"
24+
]
1525
},
1626

17-
"tags": [
18-
"aspnetcore",
19-
"authentication",
20-
"jwt",
21-
"openidconnect",
22-
"security"
23-
],
24-
25-
"compilationOptions": {
27+
"buildOptions": {
28+
"warningsAsErrors": true,
2629
"nowarn": [ "CS1591" ],
2730
"xmlDoc": true
2831
},

src/AspNet.Security.OAuth.Validation/project.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
{
22
"version": "1.0.0-alpha2-*",
33

4-
"description": "OAuth2 validation middleware for ASP.NET Core.",
5-
"authors": [ "Kévin Chalet" ],
6-
"owners": [ "Kévin Chalet" ],
7-
8-
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
9-
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
10-
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
4+
"packOptions": {
5+
"description": "OAuth2 validation middleware for ASP.NET Core.",
6+
"authors": [ "Kévin Chalet" ],
7+
"owners": [ "Kévin Chalet" ],
8+
9+
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
10+
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
11+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
12+
13+
"repository": {
14+
"type": "git",
15+
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
16+
},
1117

12-
"repository": {
13-
"type": "git",
14-
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
18+
"tags": [
19+
"aspnetcore",
20+
"authentication",
21+
"jwt",
22+
"openidconnect",
23+
"security"
24+
]
1525
},
1626

17-
"tags": [
18-
"aspnetcore",
19-
"authentication",
20-
"jwt",
21-
"openidconnect",
22-
"security"
23-
],
24-
25-
"compilationOptions": {
27+
"buildOptions": {
28+
"warningsAsErrors": true,
2629
"nowarn": [ "CS1591" ],
2730
"xmlDoc": true
2831
},

src/Owin.Security.OAuth.Introspection/OAuthIntrospectionMiddleware.cs

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using Microsoft.AspNetCore.DataProtection;
1111
using Microsoft.Extensions.Caching.Distributed;
1212
using Microsoft.Extensions.Caching.Memory;
13-
using Microsoft.Extensions.DependencyInjection;
1413
using Microsoft.Extensions.Logging;
1514
using Microsoft.Owin;
1615
using Microsoft.Owin.BuilderProperties;
@@ -39,28 +38,17 @@ public OAuthIntrospectionMiddleware(
3938
}
4039

4140
if (options.DataProtectionProvider == null) {
42-
// Create a new DI container and register
43-
// the data protection services.
44-
var services = new ServiceCollection();
41+
// Try to use the application name provided by
42+
// the OWIN host as the application discriminator.
43+
var discriminator = new AppProperties(app.Properties).AppName;
4544

46-
services.AddDataProtection(configuration => {
47-
// Try to use the application name provided by
48-
// the OWIN host as the application discriminator.
49-
var discriminator = new AppProperties(app.Properties).AppName;
45+
// When an application discriminator cannot be resolved from
46+
// the OWIN host properties, generate a temporary identifier.
47+
if (string.IsNullOrEmpty(discriminator)) {
48+
discriminator = Guid.NewGuid().ToString();
49+
}
5050

51-
// When an application discriminator cannot be resolved from
52-
// the OWIN host properties, generate a temporary identifier.
53-
if (string.IsNullOrEmpty(discriminator)) {
54-
discriminator = Guid.NewGuid().ToString();
55-
}
56-
57-
configuration.ApplicationDiscriminator = discriminator;
58-
});
59-
60-
var container = services.BuildServiceProvider();
61-
62-
// Resolve a data protection provider from the services container.
63-
options.DataProtectionProvider = container.GetRequiredService<IDataProtectionProvider>();
51+
options.DataProtectionProvider = DataProtectionProvider.Create(discriminator);
6452
}
6553

6654
if (options.AccessTokenFormat == null) {

src/Owin.Security.OAuth.Introspection/project.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
{
22
"version": "1.0.0-alpha2-*",
33

4-
"description": "OAuth2 introspection middleware for OWIN/Katana.",
5-
"authors": [ "Kévin Chalet" ],
6-
"owners": [ "Kévin Chalet" ],
4+
"packOptions": {
5+
"description": "OAuth2 introspection middleware for OWIN/Katana.",
6+
"authors": [ "Kévin Chalet" ],
7+
"owners": [ "Kévin Chalet" ],
78

8-
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
9-
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
10-
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
9+
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
10+
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
11+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
1112

12-
"repository": {
13-
"type": "git",
14-
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
15-
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
16+
},
1617

17-
"tags": [
18-
"authentication",
19-
"katana",
20-
"jwt",
21-
"openidconnect",
22-
"owin",
23-
"security"
24-
],
18+
"tags": [
19+
"authentication",
20+
"katana",
21+
"jwt",
22+
"openidconnect",
23+
"owin",
24+
"security"
25+
]
26+
},
2527

26-
"compilationOptions": {
28+
"buildOptions": {
29+
"warningsAsErrors": true,
2730
"nowarn": [ "CS1591" ],
2831
"xmlDoc": true
2932
},

src/Owin.Security.OAuth.Validation/OAuthValidationMiddleware.cs

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System;
88
using JetBrains.Annotations;
99
using Microsoft.AspNetCore.DataProtection;
10-
using Microsoft.Extensions.DependencyInjection;
1110
using Microsoft.Extensions.Logging;
1211
using Microsoft.Owin;
1312
using Microsoft.Owin.BuilderProperties;
@@ -26,28 +25,17 @@ public OAuthValidationMiddleware(
2625
}
2726

2827
if (options.DataProtectionProvider == null) {
29-
// Create a new DI container and register
30-
// the data protection services.
31-
var services = new ServiceCollection();
28+
// Try to use the application name provided by
29+
// the OWIN host as the application discriminator.
30+
var discriminator = new AppProperties(app.Properties).AppName;
3231

33-
services.AddDataProtection(configuration => {
34-
// Try to use the application name provided by
35-
// the OWIN host as the application discriminator.
36-
var discriminator = new AppProperties(app.Properties).AppName;
32+
// When an application discriminator cannot be resolved from
33+
// the OWIN host properties, generate a temporary identifier.
34+
if (string.IsNullOrEmpty(discriminator)) {
35+
discriminator = Guid.NewGuid().ToString();
36+
}
3737

38-
// When an application discriminator cannot be resolved from
39-
// the OWIN host properties, generate a temporary identifier.
40-
if (string.IsNullOrEmpty(discriminator)) {
41-
discriminator = Guid.NewGuid().ToString();
42-
}
43-
44-
configuration.ApplicationDiscriminator = discriminator;
45-
});
46-
47-
var container = services.BuildServiceProvider();
48-
49-
// Resolve a data protection provider from the services container.
50-
options.DataProtectionProvider = container.GetRequiredService<IDataProtectionProvider>();
38+
options.DataProtectionProvider = DataProtectionProvider.Create(discriminator);
5139
}
5240

5341
if (options.AccessTokenFormat == null) {

src/Owin.Security.OAuth.Validation/project.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
{
22
"version": "1.0.0-alpha2-*",
33

4-
"description": "OAuth2 validation middleware for OWIN/Katana.",
5-
"authors": [ "Kévin Chalet" ],
6-
"owners": [ "Kévin Chalet" ],
4+
"packOptions": {
5+
"description": "OAuth2 validation middleware for OWIN/Katana.",
6+
"authors": [ "Kévin Chalet" ],
7+
"owners": [ "Kévin Chalet" ],
78

8-
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
9-
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
10-
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
9+
"projectUrl": "https://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions",
10+
"iconUrl": "https://avatars3.githubusercontent.com/u/7998081?s=64",
11+
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html",
1112

12-
"repository": {
13-
"type": "git",
14-
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
15-
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git://github.com/aspnet-contrib/AspNet.Security.OAuth.Extensions"
16+
},
1617

17-
"tags": [
18-
"authentication",
19-
"katana",
20-
"jwt",
21-
"openidconnect",
22-
"owin",
23-
"security"
24-
],
18+
"tags": [
19+
"authentication",
20+
"katana",
21+
"jwt",
22+
"openidconnect",
23+
"owin",
24+
"security"
25+
]
26+
},
2527

26-
"compilationOptions": {
28+
"buildOptions": {
29+
"warningsAsErrors": true,
2730
"nowarn": [ "CS1591" ],
2831
"xmlDoc": true
2932
},

test/AspNet.Security.OAuth.Introspection.Tests/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"compilationOptions": {
2+
"buildOptions": {
33
"warningsAsErrors": true
44
},
55

66
"dependencies": {
77
"AspNet.Security.OAuth.Introspection": "1.0.0-*",
8+
"dotnet-test-xunit": "1.0.0-*",
89
"Microsoft.AspNetCore.TestHost": "1.0.0-*",
910
"Microsoft.Extensions.Caching.Memory": "1.0.0-*",
1011
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
@@ -14,7 +15,6 @@
1415
"frameworks": {
1516
"netcoreapp1.0": {
1617
"dependencies": {
17-
"dotnet-test-xunit": "1.0.0-dev-*",
1818
"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" }
1919
},
2020

@@ -26,7 +26,7 @@
2626

2727
"net451": {
2828
"dependencies": {
29-
"xunit.runner.console": "2.1.0"
29+
"Microsoft.NETCore.Platforms": "1.0.1-*"
3030
}
3131
}
3232
},

test/AspNet.Security.OAuth.Validation.Tests/project.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"compilationOptions": {
2+
"buildOptions": {
33
"warningsAsErrors": true
44
},
55

66
"dependencies": {
77
"AspNet.Security.OAuth.Validation": "1.0.0-*",
8+
"dotnet-test-xunit": "1.0.0-*",
89
"Microsoft.AspNetCore.TestHost": "1.0.0-*",
910
"Microsoft.Extensions.Caching.Memory": "1.0.0-*",
1011
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
@@ -15,7 +16,6 @@
1516
"frameworks": {
1617
"netcoreapp1.0": {
1718
"dependencies": {
18-
"dotnet-test-xunit": "1.0.0-dev-*",
1919
"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" },
2020
"moq.netcore": "4.4.0-*",
2121
"System.Diagnostics.TraceSource": "4.0.0-*"
@@ -29,8 +29,8 @@
2929

3030
"net451": {
3131
"dependencies": {
32-
"Moq": "4.2.1312.1622",
33-
"xunit.runner.console": "2.1.0"
32+
"Microsoft.NETCore.Platforms": "1.0.1-*",
33+
"Moq": "4.2.1312.1622"
3434
}
3535
}
3636
},

test/Owin.Security.OAuth.Introspection.Tests/project.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"compilationOptions": {
2+
"buildOptions": {
33
"warningsAsErrors": true
44
},
55

66
"dependencies": {
7+
"dotnet-test-xunit": "1.0.0-*",
8+
"Microsoft.NETCore.Platforms": "1.0.1-*",
79
"Microsoft.Owin.Testing": "3.0.1",
810
"Owin.Security.OAuth.Introspection": "1.0.0-*",
9-
"xunit": "2.1.0",
10-
"xunit.runner.console": "2.1.0"
11+
"xunit": "2.1.0"
1112
},
1213

1314
"frameworks": {

0 commit comments

Comments
 (0)