Skip to content

Commit 58bdf65

Browse files
committed
React to API changes in aspnet/Security
aspnet/Security@081577e
1 parent 75d6300 commit 58bdf65

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

generators/app/templates/AuthenticationExtensions.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,23 @@
66

77
using System;
88
using AspNet.Security.OAuth.<%= name %>;
9-
using Microsoft.Framework.DependencyInjection;
109
using Microsoft.Framework.Internal;
11-
using Microsoft.Framework.OptionsModel;
1210

1311
namespace Microsoft.AspNet.Builder {
1412
public static class <%= name %>AuthenticationExtensions {
15-
public static IServiceCollection Configure<%= name %>Authentication(
16-
[NotNull] this IServiceCollection services,
17-
[NotNull] Action<<%= name %>AuthenticationOptions> configuration) {
18-
return services.Configure(configuration);
19-
}
20-
21-
public static IApplicationBuilder Use<%= name %>Authentication([NotNull] this IApplicationBuilder app) {
22-
return app.UseMiddleware<<%= name %>AuthenticationMiddleware>();
13+
public static IApplicationBuilder Use<%= name %>Authentication(
14+
[NotNull] this IApplicationBuilder app,
15+
[NotNull] <%= name %>AuthenticationOptions options) {
16+
return app.UseMiddleware<<%= name %>AuthenticationMiddleware>(options);
2317
}
2418

2519
public static IApplicationBuilder Use<%= name %>Authentication(
2620
[NotNull] this IApplicationBuilder app,
2721
[NotNull] Action<<%= name %>AuthenticationOptions> configuration) {
28-
return app.UseMiddleware<<%= name %>AuthenticationMiddleware>(
29-
new ConfigureOptions<<%= name %>AuthenticationOptions>(configuration));
22+
var options = new <%= name %>AuthenticationOptions();
23+
configuration(options);
24+
25+
return app.UseMiddleware<<%= name %>AuthenticationMiddleware>(options);
3026
}
3127
}
3228
}

generators/app/templates/AuthenticationMiddleware.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ namespace AspNet.Security.OAuth.<%= name %> {
1717
public class <%= name %>AuthenticationMiddleware : OAuthMiddleware<<%= name %>AuthenticationOptions> {
1818
public <%= name %>AuthenticationMiddleware(
1919
[NotNull] RequestDelegate next,
20+
[NotNull] <%= name %>AuthenticationOptions options,
2021
[NotNull] IDataProtectionProvider dataProtectionProvider,
2122
[NotNull] ILoggerFactory loggerFactory,
2223
[NotNull] IUrlEncoder encoder,
23-
[NotNull] IOptions<SharedAuthenticationOptions> externalOptions,
24-
[NotNull] IOptions<<%= name %>AuthenticationOptions> options,
25-
ConfigureOptions<<%= name %>AuthenticationOptions> configureOptions = null)
26-
: base(next, dataProtectionProvider, loggerFactory,
27-
encoder, externalOptions, options, configureOptions) {
24+
[NotNull] IOptions<SharedAuthenticationOptions> externalOptions)
25+
: base(next, dataProtectionProvider, loggerFactory, encoder, externalOptions, options) {
2826
}
2927

3028
protected override AuthenticationHandler<<%= name %>AuthenticationOptions> CreateHandler() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-aspnet-oauth",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Yeoman generator for OAuth Providers for ASP.NET 5",
55
"license": "MIT",
66
"main": "app/index.js",

0 commit comments

Comments
 (0)