@@ -166,6 +166,16 @@ public static GitHub connect() throws IOException {
166166 return GitHubBuilder .fromCredentials ().build ();
167167 }
168168
169+ /**
170+ * Version that connects to GitHub Enterprise.
171+ *
172+ * @deprecated
173+ * Use {@link #connectToEnterpriseWithOAuth(String, String, String)}
174+ */
175+ public static GitHub connectToEnterprise (String apiUrl , String oauthAccessToken ) throws IOException {
176+ return connectToEnterpriseWithOAuth (apiUrl ,null ,oauthAccessToken );
177+ }
178+
169179 /**
170180 * Version that connects to GitHub Enterprise.
171181 *
@@ -174,10 +184,16 @@ public static GitHub connect() throws IOException {
174184 * "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL.
175185 * For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
176186 */
177- public static GitHub connectToEnterprise (String apiUrl , String oauthAccessToken ) throws IOException {
178- return new GitHubBuilder ().withEndpoint (apiUrl ).withOAuthToken (oauthAccessToken ).build ();
187+ public static GitHub connectToEnterpriseWithOAuth (String apiUrl , String login , String oauthAccessToken ) throws IOException {
188+ return new GitHubBuilder ().withEndpoint (apiUrl ).withOAuthToken (oauthAccessToken , login ).build ();
179189 }
180190
191+ /**
192+ * Version that connects to GitHub Enterprise.
193+ *
194+ * @deprecated
195+ * Use with caution. Login with password is not a preferred method.
196+ */
181197 public static GitHub connectToEnterprise (String apiUrl , String login , String password ) throws IOException {
182198 return new GitHubBuilder ().withEndpoint (apiUrl ).withPassword (login , password ).build ();
183199 }
0 commit comments