/// <exception cref="Apache.Http.HttpException"></exception> /// <exception cref="System.IO.IOException"></exception> public void Process(HttpWebRequest request, HttpContext context) { AuthState authState = (AuthState)context.GetAttribute(ClientContext.TargetAuthState ); if (authState.GetAuthScheme() == null) { authState.SetAuthScheme(new BasicScheme()); authState.SetCredentials(credentials); } }
/// <exception cref="Apache.Http.HttpException"></exception> /// <exception cref="System.IO.IOException"></exception> public void Process(HttpWebRequest request, HttpContext context) { AuthState authState = (AuthState)context.GetAttribute(ClientContext.TargetAuthState ); CredentialsProvider credsProvider = (CredentialsProvider)context.GetAttribute(ClientContext .CredsProvider); HttpHost targetHost = (HttpHost)context.GetAttribute(ExecutionContext.HttpTargetHost ); if (authState.GetAuthScheme() == null) { AuthScope authScope = new AuthScope(targetHost.GetHostName(), targetHost.GetPort( )); authState.SetAuthScheme(new BasicScheme()); authState.SetCredentials(creds); } }