Sets the Git credentials

@param username The username
@param password The password
963397
public void setCredentials(String username, String password) {
                if (GitTaskUtils.isNullOrBlankString(username) || GitTaskUtils.isNullOrBlankString(password)) {
                        throw new IllegalArgumentException("Credentials must not be empty.");
                }

                credentials = new UsernamePasswordCredentialsProvider(username, password);
        }
62687
def credentials(username, password, digest = false)
      self.username = username
      self.password = password
      self.digest = digest
    end
307623
public Iterable<PushResult> pushToRepository(Git git, String remote, String username, String password) {
        try {
            return git.push()
                .setRemote(remote)
                .setPushAll()
                .setPushTags()
                .setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
                .call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }
649826
protected function _setSmtpAuthInfo($userName = null, $userPassword = null)
    {
        $this->set("SMTPAuth", true);
        $this->set("Username", $userName);
        $this->set("Password", $userPassword);
    }
52155
public Credentials toGrgit() {
        if (username != null && password != null) {
            return new Credentials(username, password);
        } else {
            return null;
        }
    }
493453
public GitRepositoryBuilder credentialProvider(final String username, final String password) {
        if (StringUtils.hasText(username)) {
            this.credentialsProviders.add(new UsernamePasswordCredentialsProvider(username, password));
        }
        return this;
    }
1136257
public void setPassword(String username, String newPassword) throws CmsException {

        m_securityManager.setPassword(m_context, username, newPassword);
    }
359096
public FTPUploadRequest setUsernameAndPassword(String username, String password) {
        if (username == null || "".equals(username)) {
            throw new IllegalArgumentException("Specify FTP account username!");
        }

        if (password == null || "".equals(password)) {
            throw new IllegalArgumentException("Specify FTP account password!");
        }

        ftpParams.username = username;
        ftpParams.password = password;
        return this;
    }
228889
protected boolean configureServerCredentials(final GitHubClient client,
			final String serverId, final Settings settings,
			final MavenSession session) throws MojoExecutionException {
		if (StringUtils.isEmpty(serverId))
			return false;

		String serverUsername = null;
		String serverPassword = null;

        // Maven 3.1.0 - It's now impossible to retrieve the username and password from the remote repository.

//		if (session != null) {
//			RepositorySystemSession systemSession = session
//					.getRepositorySession();
//			if (systemSession != null) {
//                RemoteRepository.Builder builder = new RemoteRepository.Builder(serverId, "", "");
//                Authentication authInfo = systemSession.getAuthenticationSelector().getAuthentication
//                        (builder.build());
//				if (authInfo != null) {
//					serverUsername = authInfo.getUsername();
//					serverPassword = authInfo.getPassword();
//				}
//			}
//		}

        // Always true.
//		if (StringUtils.isEmpty(serverPassword)) {
			Server server = getServer(settings, serverId);
			if (server == null)
				throw new MojoExecutionException(MessageFormat.format(
						"Server ''{0}'' not found in settings", serverId));

			if (isDebug())
				debug(MessageFormat.format("Using ''{0}'' server credentials",
						serverId));

			{
				try
				{
					SettingsDecrypter settingsDecrypter = container.lookup( SettingsDecrypter.class );
					SettingsDecryptionResult result =
						settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( server ) );
					server = result.getServer();
				}
				catch ( ComponentLookupException cle )
				{
					throw new MojoExecutionException( "Unable to lookup SettingsDecrypter: " + cle.getMessage(), cle );
				}
			}

			serverUsername = server.getUsername();
			serverPassword = server.getPassword();
//		}

		if (!StringUtils.isEmpty(serverUsername, serverPassword)) {
			if (isDebug())
				debug("Using basic authentication with username: "
						+ serverUsername);
			client.setCredentials(serverUsername, serverPassword);
			return true;
		}

		// A server password without a username is assumed to be an OAuth2 token
		if (!StringUtils.isEmpty(serverPassword)) {
			if (isDebug())
				debug("Using OAuth2 access token authentication");
			client.setOAuth2Token(serverPassword);
			return true;
		}

		if (isDebug())
			debug(MessageFormat.format(
					"Server ''{0}'' is missing username/password credentials",
					serverId));
		return false;
	}
1245008
@Override
    public void changePassword(String username, String password)
            throws AuthenticationException {
        String user = file_store.getProperty(username);
        if (user == null) {
            throw new AuthenticationException("User '" + username
                    + "' not found.");
        }
        // Encrypt the new password
        String ePwd = encryptPassword(password);
        file_store.put(username, ePwd);
        try {
            saveUsers();
        } catch (IOException e) {
            throw new AuthenticationException("Error changing password: ", e);
        }
    }
29132
public static void setUsername(final String username) {
        if (username == null) {
            throw new AuthenticationException("Username can not be null");
        }

        if (!username.equals(Twilio.username)) {
            Twilio.invalidate();
        }

        Twilio.username = username;
    }
816232
public void setCredential(String username, String password) {
	if (username != null) {
	    env.put("java.naming.security.principal", username);
	    env.put("java.naming.security.credentials", password);
	}
	else {
	    env.remove("java.naming.security.principal");
	    env.remove("java.naming.security.credentials");
	}
    }
1355293
public static void init(final String username, final String password, final String accountSid) {
        Twilio.setUsername(username);
        Twilio.setPassword(password);
        Twilio.setAccountSid(accountSid);
    }
76950
public function setDigestAuthentication($username, $password = '')
    {
        $this->setOpt(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
        $this->setOpt(CURLOPT_USERPWD, $username . ':' . $password);
    }
1098845
public function setAuth($username = null, $password = null)
    {
        $this->username = $username;
        $this->password = $password;
    }
429848
public void setBasicUsernamePassword(String username, String password) {
        this.username = username;
        this.password = password;
        LOG.debug("use basic username/password {}/********", username);

        userPassCredentialsProvider = new BasicCredentialsProvider();
        userPassCredentialsProvider.setCredentials(AuthScope.ANY,
            new UsernamePasswordCredentials(username, password));

        authCache = new BasicAuthCache();
        BasicScheme basicAuth = new BasicScheme();
        authCache.put(httpHost, basicAuth);
    }
1261245
public void setPassword(CharSequence password) {

        LettuceAssert.notNull(password, "Password must not be null");
        this.password = password.toString().toCharArray();
    }