diff --git a/src/OpenIddict.Mvc/project.json b/src/OpenIddict.Mvc/project.json
index 5168cbe2..c5259a6d 100644
--- a/src/OpenIddict.Mvc/project.json
+++ b/src/OpenIddict.Mvc/project.json
@@ -7,25 +7,18 @@
"dependencies": {
"AspNet.Hosting.Extensions": "1.0.0-*",
-
- "Microsoft.AspNet.FileProviders.Composite": "1.0.0-*",
- "Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*",
- "Microsoft.AspNet.Mvc": "6.0.0-*",
-
- "Microsoft.Extensions.NotNullAttribute.Sources": {
- "type": "build",
- "version": "1.0.0-*"
- },
-
+ "JetBrains.Annotations": "10.1.2-eap",
+ "Microsoft.AspNetCore.Mvc": "1.0.0-*",
+ "Microsoft.Extensions.FileProviders.Embedded": "1.0.0-*",
+ "Microsoft.Extensions.FileProviders.Composite": "1.0.0-*",
"OpenIddict.Core": "1.0.0-*"
},
"frameworks": {
- "dnx451": { },
- "dnxcore50": {
- "dependencies": {
- "System.Reflection": "4.1.0-*"
- }
+ "net451": { },
+
+ "dotnet5.6": {
+ "imports": "portable-net451+win8"
}
}
}
\ No newline at end of file
diff --git a/src/OpenIddict.Security/OpenIddictExtensions.cs b/src/OpenIddict.Security/OpenIddictExtensions.cs
index b5335eb4..d1199240 100644
--- a/src/OpenIddict.Security/OpenIddictExtensions.cs
+++ b/src/OpenIddict.Security/OpenIddictExtensions.cs
@@ -1,10 +1,14 @@
using System;
-using Microsoft.Extensions.Internal;
+using JetBrains.Annotations;
using NWebsec.Middleware;
-namespace Microsoft.AspNet.Builder {
+namespace Microsoft.AspNetCore.Builder {
public static class OpenIddictExtensions {
public static OpenIddictBuilder UseNWebsec([NotNull] this OpenIddictBuilder builder) {
+ if (builder == null) {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
return builder.UseNWebsec(options => {
options.DefaultSources(directive => directive.Self())
.ImageSources(directive => directive.Self().CustomSources("*"))
@@ -16,6 +20,14 @@ namespace Microsoft.AspNet.Builder {
public static OpenIddictBuilder UseNWebsec(
[NotNull] this OpenIddictBuilder builder,
[NotNull] Action
configuration) {
+ if (builder == null) {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
+ if (configuration == null) {
+ throw new ArgumentNullException(nameof(configuration));
+ }
+
return builder.AddModule("NWebsec", 5, app => {
// Insert a new middleware responsible of setting the Content-Security-Policy header.
// See https://nwebsec.codeplex.com/wikipage?title=Configuring%20Content%20Security%20Policy&referringTitle=NWebsec
@@ -36,7 +48,10 @@ namespace Microsoft.AspNet.Builder {
}
public static OpenIddictBuilder UseCors([NotNull] this OpenIddictBuilder builder) {
- //Add CORS to the app
+ if (builder == null) {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
builder.AddModule("CORS", -10, map => map.UseCors(options => {
options.AllowAnyHeader();
options.AllowAnyMethod();
diff --git a/src/OpenIddict.Security/project.json b/src/OpenIddict.Security/project.json
index 32fa44fa..c7551494 100644
--- a/src/OpenIddict.Security/project.json
+++ b/src/OpenIddict.Security/project.json
@@ -4,19 +4,20 @@
"description": "Security headers module for OpenIddict.",
"dependencies": {
+ "JetBrains.Annotations": "10.1.2-eap",
"OpenIddict.Core": "1.0.0-*",
+
"NWebsec": {
"type": "build",
"version": "1.0.0-internal-*"
- },
- "Microsoft.Extensions.NotNullAttribute.Sources": {
- "type": "build",
- "version": "1.0.0-*"
}
},
- "frameworks": {
- "dnx451": { },
- "dnxcore50": { }
- }
+ "frameworks": {
+ "net451": { },
+
+ "dotnet5.4": {
+ "imports": "portable-net451+win8"
+ }
+ }
}
diff --git a/src/OpenIddict/OpenIddictExtensions.cs b/src/OpenIddict/OpenIddictExtensions.cs
index 59238a36..4dff0ac5 100644
--- a/src/OpenIddict/OpenIddictExtensions.cs
+++ b/src/OpenIddict/OpenIddictExtensions.cs
@@ -1,17 +1,21 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
- * See https://github.com/openiddict/core for more information concerning
+ * See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using System;
-using Microsoft.AspNet.Identity;
-using Microsoft.Extensions.Internal;
+using JetBrains.Annotations;
+using Microsoft.AspNetCore.Identity;
using OpenIddict.Models;
-namespace Microsoft.AspNet.Builder {
+namespace Microsoft.AspNetCore.Builder {
public static class OpenIddictExtensions {
public static IdentityBuilder AddOpenIddict([NotNull] this IdentityBuilder builder) {
+ if (builder == null) {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
return builder.AddOpenIddictCore(configuration => {
// Use the EF adapter by default.
configuration.UseEntityFramework();
@@ -20,6 +24,10 @@ namespace Microsoft.AspNet.Builder {
public static IdentityBuilder AddOpenIddict([NotNull] this IdentityBuilder builder)
where TApplication : Application {
+ if (builder == null) {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
return builder.AddOpenIddictCore(configuration => {
// Use the EF adapter by default.
configuration.UseEntityFramework();
@@ -33,6 +41,14 @@ namespace Microsoft.AspNet.Builder {
public static IApplicationBuilder UseOpenIddict(
[NotNull] this IApplicationBuilder app,
[NotNull] Action configuration) {
+ if (app == null) {
+ throw new ArgumentNullException(nameof(app));
+ }
+
+ if (configuration == null) {
+ throw new ArgumentNullException(nameof(configuration));
+ }
+
return app.UseOpenIddictCore(builder => {
builder.UseAssets();
builder.UseCors();
diff --git a/src/OpenIddict/project.json b/src/OpenIddict/project.json
index 6380531a..5cd7f71d 100644
--- a/src/OpenIddict/project.json
+++ b/src/OpenIddict/project.json
@@ -4,19 +4,18 @@
"description": "Easy-to-use OpenID Connect server for ASP.NET 5.",
"dependencies": {
+ "JetBrains.Annotations": "10.1.2-eap",
"OpenIddict.Assets": "1.0.0-*",
"OpenIddict.EF": "1.0.0-*",
"OpenIddict.Mvc": "1.0.0-*",
- "OpenIddict.Security": "1.0.0-*",
-
- "Microsoft.Extensions.NotNullAttribute.Sources": {
- "type": "build",
- "version": "1.0.0-*"
- }
+ "OpenIddict.Security": "1.0.0-*"
},
"frameworks": {
- "dnx451": { },
- "dnxcore50": { }
+ "net451": { },
+
+ "dotnet5.6": {
+ "imports": "portable-net451+win8"
+ }
}
}
\ No newline at end of file