React to Named Options going away in Auth test
This commit is contained in:
parent
b34dd3b812
commit
2b52942faf
|
|
@ -5,7 +5,6 @@ using Microsoft.AspNet.Authentication;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.Framework.WebEncoders;
|
using Microsoft.Framework.WebEncoders;
|
||||||
using Microsoft.Framework.Logging;
|
using Microsoft.Framework.Logging;
|
||||||
using Microsoft.Framework.OptionsModel;
|
|
||||||
|
|
||||||
namespace FiltersWebSite
|
namespace FiltersWebSite
|
||||||
{
|
{
|
||||||
|
|
@ -13,12 +12,11 @@ namespace FiltersWebSite
|
||||||
{
|
{
|
||||||
public AuthorizeBasicMiddleware(
|
public AuthorizeBasicMiddleware(
|
||||||
RequestDelegate next,
|
RequestDelegate next,
|
||||||
IOptions<BasicOptions> options,
|
|
||||||
ILoggerFactory loggerFactory,
|
ILoggerFactory loggerFactory,
|
||||||
IUrlEncoder encoder,
|
IUrlEncoder encoder,
|
||||||
string authScheme) :
|
string authScheme) :
|
||||||
base(next, options, loggerFactory, encoder,
|
base(next, new BasicOptions { AuthenticationScheme = authScheme }, loggerFactory,
|
||||||
new ConfigureOptions<BasicOptions>(o => o.AuthenticationScheme = authScheme))
|
encoder, configureOptions: null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,12 @@ using Microsoft.Framework.OptionsModel;
|
||||||
|
|
||||||
namespace FiltersWebSite
|
namespace FiltersWebSite
|
||||||
{
|
{
|
||||||
public class BasicOptions : AuthenticationOptions
|
public class BasicOptions : AuthenticationOptions, IOptions<BasicOptions>
|
||||||
{
|
{
|
||||||
public BasicOptions()
|
public BasicOptions()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BasicOptions Value { get { return this; } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue