in TeamCity.GitHubIssues-server/src/main/java/jetbrains/buildServer/issueTracker/github/auth/GitHubAuthenticator.java [32:50]
public GitHubAuthenticator(@NotNull final Map<String, String> properties, SProject project, OAuthTokensStorage tokenStorage) {
final String authType = properties.get(PARAM_AUTH_TYPE);
if (AUTH_LOGINPASSWORD.equals(authType)) {
final String username = properties.get(PARAM_USERNAME);
final String password = properties.get(PARAM_PASSWORD);
myCredentials = new UsernamePasswordCredentials(username, password);
} else if (AUTH_ACCESSTOKEN.equals(authType)) {
final String token = properties.get(PARAM_ACCESS_TOKEN);
if (!StringUtil.isEmptyOrSpaces(token)) {
myCredentials = new TokenCredentials(token);
}
} else if (AUTH_STORED_TOKEN.equals(authType)) {
final String tokenId = properties.get(PARAM_TOKEN_ID);
final OAuthToken gitHubOAuthToken = tokenStorage.getToken(project, tokenId, true, true);
if (gitHubOAuthToken != null) {
myCredentials = new TokenCredentials(gitHubOAuthToken.getAccessToken());
}
}
}