code: public synchronized void refreshWithPassword(PasswordProvider passwordProvider, String clientToken) throws AuthenticationException {
  		Objects.requireNonNull(passwordProvider);
  		Objects.requireNonNull(clientToken);
  
  		String username = passwordProvider.getUsername();
  		String password = passwordProvider.getPassword();
  		authResult = authenticationService.login(username, password, clientToken);
  		if (authResult.getSelectedProfile() == null) {
  			GameProfile[] profiles = authResult.getProfiles();
  			if (profiles == null || profiles.length == 0) {
  				return;
  			}
  
  			// no profile is selected
  			// let's select one
  			CharacterSelector selector = passwordProvider.getCharacterSelector();
  			if (selector == null) {
  				selector = new DefaultCharacterSelector();
  			}
  
  			GameProfile selectedProfile = selector.select(profiles);
  			if (selectedProfile != null) {
  				authResult = authenticationService.selectProfile(authResult.getClientToken(), authResult.getAccessToken(), selectedProfile);
  			}
  		}
  	}
docs: Refreshes the current session manually using password.
  
  @param passwordProvider the password provider
  @param clientToken the client token
  @throws AuthenticationException If an exception occurs during the
  authentication