code: public void authenticate(GSSCredential credential,
                               String username)
          throws IOException, ServerException {
          ((GridFTPControlChannel)controlChannel).authenticate(credential,
                                                               username);
          gLocalServer.setCredential(credential);
          gSession.authorized = true;
          this.username = username;
  
          // quietly send version information to the server.
          // ignore errors
          try
          {
              String version = Version.getVersion();
  
              this.site(usageString);
          }
          catch (Exception ex)
          {
          }
      }
docs: Performs authentication with specified user credentials and
  a specific username (assuming the user dn maps to the passed username).
  
  @param credential user credentials to use.
  @param username specific username to authenticate as.
  @throws IOException on i/o error
  @throws ServerException on server refusal or faulty server behavior