diff --git a/pom.xml b/pom.xml
index fa92e01f..a82bce8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,7 +63,7 @@
org.jenkins-ci.plugins
github-api
- 1.28
+ 1.34
diff --git a/src/main/java/org/jenkinsci/plugins/GithubSecurityRealm.java b/src/main/java/org/jenkinsci/plugins/GithubSecurityRealm.java
index 8192d61b..cb2aa396 100644
--- a/src/main/java/org/jenkinsci/plugins/GithubSecurityRealm.java
+++ b/src/main/java/org/jenkinsci/plugins/GithubSecurityRealm.java
@@ -309,10 +309,8 @@ public HttpResponse doFinishLogin(StaplerRequest request)
if (accessToken != null && accessToken.trim().length() > 0) {
- String githubServer = githubUri.replaceFirst("http.*\\/\\/", "");
-
// only set the access token if it exists.
- GithubAuthenticationToken auth = new GithubAuthenticationToken(accessToken,githubServer);
+ GithubAuthenticationToken auth = new GithubAuthenticationToken(accessToken,githubUri);
SecurityContextHolder.getContext().setAuthentication(auth);
GHUser self = auth.getGitHub().getMyself();