Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.DefaultCredentialsProvider$AuthScopeProxy


    * @param userName The user name to send.
    * @param password The password to send.
    */
   public BasicAuthenticationStrategy(String userName, String password)
   {
      this.credProvider = new DefaultCredentialsProvider();
      this.credProvider.addCredentials(userName, password);
   }
View Full Code Here


  // that does not require authentication the credentials will not be consulted anyway, so it's ok to
  // leave user/password null or blank in those situations.)
    // package protected for testing purposes
    static WebClient setupWebClient(final BrowserVersion browserVersion) {
    final WebClient webClient;
    final DefaultCredentialsProvider credentialProvider = new DefaultCredentialsProvider();
        String proxyHost = System.getProperty("http.proxyHost");
        if (proxyHost != null && proxyHost.length() > 0) {
            // the properties are set for instance by org.apache.tools.ant.taskdefs.optional.net.SetProxy

            // the proxy setting
View Full Code Here

    }
    if (hasSuppliedCredentials()) {
      LOG.info("Setting password for username: " + fUserName);
      // credentials provider has already been set as DefaultCredentialsProvider
      // in Setup (may already contain credentials for proxy)
      final DefaultCredentialsProvider credentialsProvider =
        (DefaultCredentialsProvider) context.getWebClient().getCredentialsProvider();
      credentialsProvider.addCredentials(fUserName, fPassword);
      context.setSavedUserName(fUserName);
      context.setSavedPassword(fPassword);
    }
   
    final Configuration config = context.getConfig();
View Full Code Here

            settings.setAdditionalHeader("Referer", containingPage_.getWebResponse().getRequestSettings().getUrl()
                    .toExternalForm());
            final HttpMethod submitMethod = HttpMethod.valueOf(method.toUpperCase());
            settings.setHttpMethod(submitMethod);
            if (user != null) {
                final DefaultCredentialsProvider dcp = new DefaultCredentialsProvider();
                dcp.addCredentials(user, password);
                settings.setCredentialsProvider(dcp);
            }
            requestSettings_ = settings;
        }
        catch (final MalformedURLException e) {
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.DefaultCredentialsProvider$AuthScopeProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.