Examples of UsernamePasswordCredentials


Examples of com.esri.gpt.framework.security.credentials.UsernamePasswordCredentials

  LdapClient client = null;
  try {
   
    // initialize parameters
    String sUsername = user.getProfile().getUsername();
    UsernamePasswordCredentials origCred = criteria.getOriginalCredentials();
    UsernamePasswordCredentials newCred = criteria.getNewCredentials();
    origCred.setUsername(sUsername);
    newCred.setUsername(sUsername);
   
    // ensure that the old password was supplied correctly for the user
    UsernamePasswordCredentials testCred = new UsernamePasswordCredentials();
    testCred.setUsername(origCred.getUsername());
    testCred.setPassword(origCred.getPassword());
    User testUser = new User();
    testUser.setCredentials(testCred);
    authenticate(testUser);
   
    // ensure that the new credentials are valid
View Full Code Here

Examples of com.hazelcast.security.UsernamePasswordCredentials

            authenticated = false;
            logger.severe("Could not retrieve Credentials object!");
        } else if (clientEngine.getSecurityContext() != null) {
            authenticated = authenticate(clientEngine.getSecurityContext());
        } else if (credentials instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials;
            authenticated = authenticate(usernamePasswordCredentials);
        } else {
            authenticated = false;
            logger.severe("Hazelcast security is disabled.\nUsernamePasswordCredentials or cluster "
                    + "group-name and group-password should be used for authentication!\n"
View Full Code Here

Examples of com.microsoft.tfs.core.httpclient.UsernamePasswordCredentials

    @Override
    public ConnectionStatus configure(String url, String username, String password) {

        try {
            Credentials credentials = new UsernamePasswordCredentials(username, password);

            URI uri = null;
            try {
                uri = new URI(url);
            } catch (URISyntaxException e) {
View Full Code Here

Examples of net.rim.device.api.io.messaging.UsernamePasswordCredentials

                    new CredentialsCollector() {
                        public UsernamePasswordCredentials
                                getBasicAuthenticationCredentials(
                                        final String authenticatedEntityID,
                                        final Hashtable properties) {
                            return new UsernamePasswordCredentials(user, pass);
                        }
                    };

            final Context context =
                    new Context("Authenticate", credentialsCollector);
View Full Code Here

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials

      IProxyData[] proxies = _proxyService.select(_uri);
      if (proxies != null && proxies.length > 0) {
        IProxyData proxy = proxies[0];
        getHostConfiguration().setProxy(proxy.getHost(), proxy.getPort());
        if (proxy.isRequiresAuthentication()) {
          Credentials credentials = new UsernamePasswordCredentials(proxy.getUserId(), proxy.getPassword());
          getState().setProxyCredentials(AuthScope.ANY, credentials);       
        } else {
          getState().setProxyCredentials(AuthScope.ANY, null);
        }
      } else {
View Full Code Here

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials

                    if (domain != null) {
                        /*Credentials for NTLM Authentication*/
                        creds = new NTCredentials(username, password, host, domain);
                    } else {
                        /*Credentials for Digest and Basic Authentication*/
                        creds = new UsernamePasswordCredentials(username, password);
                    }
                    agent.getState().setCredentials(new AuthScope(host, port, realm), creds);
                } else {
                    if (domain != null) {
                        /*Credentials for NTLM Authentication when host is ANY_HOST*/
                        creds = new NTCredentials(username, password, AuthScope.ANY_HOST, domain);
                        agent.getState().setCredentials(
                                new AuthScope(AuthScope.ANY_HOST, port, realm), creds);
                    } else {
                        /*Credentials only for Digest and Basic Authentication*/
                        creds = new UsernamePasswordCredentials(username, password);
                        agent.getState().setCredentials(new AuthScope(AuthScope.ANY), creds);
                    }
                }
                /* Customizing the priority Order */
                List schemes = authenticator.getAuthSchemes();
View Full Code Here

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials

            client.setHostConfiguration(config);

            if (username != null)
            {
                final UsernamePasswordCredentials creds =
                    new UsernamePasswordCredentials(username, password);
                client.getState().setCredentials(null, hostname, creds);
            }

            client.executeMethod(new HeadMethod());
        }
View Full Code Here

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials

          mDestination.getName(), "Password");
      HttpState state = client.getState();
      state.setCredentials(
          new AuthScope(client.getHostConfiguration().getHost(),
              client.getHostConfiguration().getPort(), realm),
          new UsernamePasswordCredentials(user, password));
      HttpClientParams params = new HttpClientParams();
      params.setAuthenticationPreemptive(config.getValueAsBooleanOptional(
          Constants.CHAPTER_SYSTEM, mDestination.getName(),
          "AuthenticationPreemptive"));
      client.setParams(params);
View Full Code Here

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials

      logger.debug("Setting username '{}' and password for server at {}.", username, serverURL);
      try {
        URL server = new URL(serverURL);
        authScope = new AuthScope(server.getHost(), AuthScope.ANY_PORT);
        httpClient.getState().setCredentials(authScope,
            new UsernamePasswordCredentials(username, password));
        httpClient.getParams().setAuthenticationPreemptive(true);
      }
      catch (MalformedURLException e) {
        logger.warn("Unable to set username and password for malformed URL {}", serverURL);
      }
View Full Code Here

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials

    String password = NetPropertiesHandler.password;
    if (NetPropertiesHandler.proxyOn
        && (userName != null && userName.length() > 0)
        && (password != null && password.length() > 0)) {
      hClient.getState().setProxyCredentials(AuthScope.ANY,
          new UsernamePasswordCredentials(userName, password));
    }
    return hConf;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.