Temporarily borrow a user's credentials to run an opportunistic user data refresh

@param username
@param password
12740
public synchronized void opportunisticallyRefreshUserData(final String username, final String password)
	{
		if (shouldOpportunisticallyRefreshUserData())
		{
			this.lastOpportunisticUserDataRefresh = System.currentTimeMillis();
			Thread thread = new Thread(() -> refreshAllUserData(ldap.parseUser(username), password, true));
			thread.setDaemon(true);
			thread.setName("UserManager_OpportunisticRefresh");
			thread.start();
		}
	}
759438
function(password) {
      var user = this.getAuth();
      if (user) {
        return this._q.when(user.updatePassword(password));
      } else {
        return this._q.reject("Cannot update password since there is no logged in user.");
      }
    }
228900
public static AuthenticationData createAuthenticationData(String userName, String password) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, CLASS_NAME + "createAuthenticationData", new Object[] { userName, "Password Not Traced" });
        }
        AuthenticationData authData = new WSAuthenticationData();
        if (userName == null)
            userName = "";
        if (password == null)
            password = "";
        authData.set(AuthenticationData.USERNAME, userName);
        authData.set(AuthenticationData.PASSWORD, new ProtectedString(password.toCharArray()));
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, CLASS_NAME + "createAuthenticationData", authData);
        }
        return authData;
    }
1112438
public ControllerRoute withBasicAuthentication(String username, String password) {
        Objects.requireNonNull(username, Required.USERNAME.toString());
        Objects.requireNonNull(password, Required.PASSWORD.toString());
        
        this.username = username;
        this.password = password;
        
        return this;
    }
1369298
public void login(String username, String password) {
        Object[] methodArgs = new Object[1];
        if (username != null && username.indexOf('@') > 1) {
            EmailAuth emailpass = new EmailAuth(username, password);
            methodArgs[0] = emailpass;
        } else {
            UsernameAuth userpass = new UsernameAuth(username, password);
            methodArgs[0] = userpass;
        }
        
        getDDP().call("login", methodArgs, new DDPListener() {
            @Override
            public void onResult(Map<String, Object> jsonFields) {
                handleLoginResult(jsonFields);
            }
        });
    }
1163288
public void connect(String username, char[] password) {
        doConnect(() -> {
            return CommandContextFactory.getInstance().
                    newCommandContext(new CommandContextConfiguration.Builder()
                    .setUsername(username)
                    .setPassword(password)
                    .setErrorOnInteract(false)
                    .build());
        });
    }
98800
@CommandArgument
  public void passwd(
      @OptionArgument("username") String username,
      @OptionArgument("password") String password) {

    User user = users.get(username);

    if (user != null) {
      user.salt = passwd.generateSalt();
      user.hash = passwd.getEncryptedPassword(password, user.salt);
    } else {
      System.err.println(String.format("User '%s' does not exist", username));
    }

  }
645106
def setUserPasswdCredentials(self, username, password):
        """"""

        self.setCredentialValues(username=username, password=password)
29861
private Credential newCredential(String userId) {
        Credential.Builder builder = new Credential.Builder(getMethod())
                .setTransport(getTransport())
                .setJsonFactory(getJsonFactory())
                .setTokenServerEncodedUrl(getTokenServerEncodedUrl())
                .setClientAuthentication(getClientAuthentication())
                .setRequestInitializer(getRequestInitializer())
                .setClock(getClock());
        if (getCredentialStore() != null) {
            builder.addRefreshListener(
                    new CredentialStoreRefreshListener(userId, getCredentialStore()));
        }

        builder.getRefreshListeners().addAll(getRefreshListeners());

        return builder.build();
    }
113518
public void signin(String username, String password) {
		logger.debug("signin:" + username);

		Authentication request = new UsernamePasswordAuthenticationToken(username, password, null);
		SecurityContextHolder.getContext().setAuthentication(request);
	}
650268
public static void setUser(String userName, String password){
        getImpl().getDirectoryServiceClient().setUser(userName, password);
    }
27775
public void login(String username, String password) {

        username = OpenCms.getImportExportManager().translateUser(username);
        try {
            m_cms.loginUser(username, password);
            // reset the settings, this will switch the startup site root etc.
            m_shell.initSettings();
            m_shell.getOut().println(getMessages().key(Messages.GUI_SHELL_LOGIN_1, whoami().getName()));
            // output the login message if required
            CmsLoginMessage message = OpenCms.getLoginManager().getLoginMessage();
            if ((message != null) && (message.isActive())) {
                m_shell.getOut().println(message.getMessage());
            }
        } catch (Exception exc) {
            m_shell.getOut().println(getMessages().key(Messages.GUI_SHELL_LOGIN_FAILED_0));
        }
    }
1166751
def setCredentials(self, user, password):
        
        self._checkUserAndPass(user, password)
        self.user = user
        self.password = password
552473
public HttpClientBuilder basicAuth(String username, String password) {
		basicAuthUsername = username;
		basicAuthPassword = password;
		return this;
	}
333984
public void setUsername(String username) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof HttpBasicAuth) {
                ((HttpBasicAuth) auth).setUsername(username);
                return;
            }
        }
        throw new RuntimeException("No HTTP basic authentication configured!");
    }
12394
public synchronized void refreshWithPassword(String username, String password, CharacterSelector characterSelector) throws AuthenticationException {
		refreshWithPassword(createPasswordProvider(username, password, characterSelector));
	}
96461
public Session login(final String username, final String password) throws RepositoryException {
        assertStateAfterOrEqual(State.CREATED);
        if (!userSessions.containsKey(username)) {
            userSessions.put(username, getRepository().login(new SimpleCredentials(username, password.toCharArray())));
        }
        return userSessions.get(username);
    }