code: protected GitHubClient createClient(String host, String userName,
  			String password, String oauth2Token, String serverId,
  			Settings settings, MavenSession session)
  			throws MojoExecutionException {
  		GitHubClient client;
  		if (!StringUtils.isEmpty(host)) {
  			if (isDebug())
  				debug("Using custom host: " + host);
  			client = createClient(host);
  		} else
  			client = createClient();
  
  		{
  			Proxy proxy = getProxy( settings, serverId, host );
  			if ( null != proxy )
  			{
  				try
  				{
  					SettingsDecrypter settingsDecrypter = container.lookup( SettingsDecrypter.class );
  					SettingsDecryptionResult result =
  						settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( proxy ) );
  					proxy = result.getProxy();
  				}
  				catch ( ComponentLookupException cle )
  				{
  					throw new MojoExecutionException( "Unable to lookup SettingsDecrypter: " + cle.getMessage(), cle );
  				}
  			}
  
  			if ( null != proxy ){
  				java.net.Proxy javaProxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress( proxy.getHost(), proxy.getPort()));
  				if (isDebug())
  					debug(MessageFormat.format("Found Proxy {0}:{1}",
  							proxy.getHost(), proxy.getPort()));
  
  				if ( client instanceof GitHubClientEgit )
  				{
  					GitHubClientEgit clientEgit = (GitHubClientEgit)client;
  					if (isDebug())
  						debug(MessageFormat.format("Use Proxy for Egit {0}",
  								javaProxy));
  					clientEgit.setProxy( javaProxy );
  				}
  			}
  		}
  
  		if (configureUsernamePassword(client, userName, password)
  				|| configureOAuth2Token(client, oauth2Token)
  				|| configureServerCredentials(client, serverId, settings,
  						session))
  			return client;
  		else
  			throw new MojoExecutionException(
  					"No authentication credentials configured");
  	}
docs: Create client
  
  @param host
  @param userName
  @param password
  @param oauth2Token
  @param serverId
  @param settings
  @param session
  @return client
  @throws MojoExecutionException