public RequireBasicAuthenticationAttribute(string basicRealm, string requiredUserName, string requiredPassword, IBasicAuthenticationProvider authenticator) { _basicRealm = basicRealm; if (requiredUserName != null || requiredPassword != null) _requiredCredentials = new BasicAuthenticationCredentials(requiredUserName, requiredPassword); _authenticator = authenticator; }
public RequireBasicAuthenticationAttribute(string basicRealm, string requiredUserName, string requiredPassword, IBasicAuthenticationProvider authenticator) { _basicRealm = basicRealm; if (requiredUserName != null || requiredPassword != null) { _requiredCredentials = new BasicAuthenticationCredentials(requiredUserName, requiredPassword); } _authenticator = authenticator; }
public BasicAuthenticationProtocol(IBasicAuthenticationProvider provider, string realm) { if (provider == null) { throw new ArgumentNullException("provider"); } _provider = provider; _realm = realm; }
public BasicAuthenticationHandler( IOptionsMonitor <AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IBasicAuthenticationProvider authenticationProvider) : base(options, logger, encoder, clock) { this._authenticationProvider = authenticationProvider; }
/// <summary></summary> /// <param name="appBuilder"></param> /// <param name="provider"></param> public static void UseBasicAuthentication(this IAppBuilder appBuilder, IBasicAuthenticationProvider provider) { if (provider == null) { throw new ArgumentNullException("provider"); } BasicAuthenticationOptions options = new BasicAuthenticationOptions { Provider = provider }; UseBasicAuthentication(appBuilder, options); }
public void Setup() { _response = Substitute.For <HttpResponseBase>(); var httpContext = Substitute.For <HttpContextBase>(); httpContext.Response.Returns(_response); var controller = Substitute.For <ControllerBase>(); var actionDescriptor = Substitute.For <ActionDescriptor>(); var controllerContext = new ControllerContext(httpContext, new RouteData(), controller); _attributeContext = new ActionExecutingContext(controllerContext, actionDescriptor, new Dictionary <string, object>()); _authenticator = Substitute.For <IBasicAuthenticationProvider>(); }
public BasicToGenericProviderAdapter(IBasicAuthenticationProvider basic) { Debug.Assert(basic != null); _basic = basic; }
public void Setup() { response = Substitute.For<HttpResponseBase>(); var httpContext = Substitute.For<HttpContextBase>(); httpContext.Response.Returns(response); var controller = Substitute.For<ControllerBase>(); var actionDescriptor = Substitute.For<ActionDescriptor>(); var controllerContext = new ControllerContext(httpContext, new RouteData(), controller); attributeContext = new ActionExecutingContext(controllerContext, actionDescriptor, new Dictionary<string, object>()); authenticator = Substitute.For<IBasicAuthenticationProvider>(); }