Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8c78d20

Browse filesBrowse files
committed
doc improvement
1 parent abe78cf commit 8c78d20
Copy full SHA for 8c78d20

File tree

Expand file treeCollapse file tree

1 file changed

+25
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+25
-2
lines changed

‎src/main/java/org/kohsuke/github/GitHub.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GitHub.java
+25-2Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,38 @@ private GitHub(String login, String oauthAccessToken, String password) throws IO
7575
}
7676

7777
/**
78+
* Creates a client API root object.
79+
*
80+
* <p>
81+
* Several different combinations of the login/oauthAccessToken/password parameters are allowed
82+
* to represent different ways of authentication.
83+
*
84+
* <dl>
85+
* <dt>Loging anonymously
86+
* <dd>Leave all three parameters null and you will be making HTTP requests without any authentication.
87+
*
88+
* <dt>Log in with password
89+
* <dd>Specify the login and password, then leave oauthAccessToken null.
90+
* This will use the HTTP BASIC auth with the GitHub API.
91+
*
92+
* <dt>Log in with OAuth token
93+
* <dd>Specify oauthAccessToken, and optionally specify the login. Leave password null.
94+
* This will send OAuth token to the GitHub API. If the login parameter is null,
95+
* The constructor makes an API call to figure out the user name that owns the token.
96+
* </dl>
7897
*
7998
* @param apiUrl
8099
* The URL of GitHub (or GitHub enterprise) API endpoint, such as "https://api.github.com" or
81100
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL.
82101
* For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
83102
* Password is also considered deprecated as it is no longer required for api usage.
84103
* @param login
85-
* The use ID on GitHub. Can be omitted if the OAuth token is provided, but specifying this would
86-
* save one API call.
104+
* The use ID on GitHub that you are logging in as. Can be omitted if the OAuth token is
105+
* provided or if logging in anonymously. Specifying this would save one API call.
106+
* @param oauthAccessToken
107+
* Secret OAuth token.
108+
* @param password
109+
* User's password. Always used in conjunction with the {@code login} parameter
87110
*/
88111
private GitHub(String apiUrl, String login, String oauthAccessToken, String password) throws IOException {
89112
if (apiUrl.endsWith("/")) apiUrl = apiUrl.substring(0, apiUrl.length()-1); // normalize

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.