summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaša Živkov <zivkov@gmail.com>2015-03-26 12:33:17 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-26 12:33:24 +0000
commitca29f4292f387e1b1a60ea5f83d7a5b1b7d7b385 (patch)
treea7155552615f0c80091f3b3c6a83c0c7cfe70ec3
parent61915d1f8ee65ba02fecbac99952379786696fd6 (diff)
parent3408d4deb866a54580f836ff109f3ef6ba940d45 (diff)
Merge "Remove unused OAuthToken in authorisation URL" into stable-2.10
-rw-r--r--gerrit-extension-api/src/main/java/com/google/gerrit/extensions/auth/oauth/OAuthServiceProvider.java15
-rw-r--r--gerrit-oauth/src/main/java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java5
2 files changed, 5 insertions, 15 deletions
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/auth/oauth/OAuthServiceProvider.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/auth/oauth/OAuthServiceProvider.java
index 8375e3179e..9be2630792 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/auth/oauth/OAuthServiceProvider.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/auth/oauth/OAuthServiceProvider.java
@@ -23,29 +23,20 @@ import java.io.IOException;
public interface OAuthServiceProvider {
/**
- * Retrieve the request token.
- *
- * @return request token
- */
- OAuthToken getRequestToken();
-
- /**
* Returns the URL where you should redirect your users to authenticate
* your application.
*
- * @param requestToken the request token you need to authorize
- * @return the URL where you should redirect your users
+ * @return the OAuth service URL to redirect your users for authentication
*/
- String getAuthorizationUrl(OAuthToken requestToken);
+ String getAuthorizationUrl();
/**
* Retrieve the access token
*
- * @param requestToken request token (obtained previously)
* @param verifier verifier code
* @return access token
*/
- OAuthToken getAccessToken(OAuthToken requestToken, OAuthVerifier verifier);
+ OAuthToken getAccessToken(OAuthVerifier verifier);
/**
* After establishing of secure communication channel, this method supossed to
diff --git a/gerrit-oauth/src/main/java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java b/gerrit-oauth/src/main/java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java
index 6e3ea7aad6..8ffbbe643e 100644
--- a/gerrit-oauth/src/main/java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java
+++ b/gerrit-oauth/src/main/java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java
@@ -89,8 +89,7 @@ class OAuthSession {
}
log.debug("Login-Retrieve-User " + this);
- token = oauth.getAccessToken(null,
- new OAuthVerifier(request.getParameter("code")));
+ token = oauth.getAccessToken(new OAuthVerifier(request.getParameter("code")));
user = oauth.getUserInfo(token);
@@ -105,7 +104,7 @@ class OAuthSession {
} else {
log.debug("Login-PHASE1 " + this);
redirectUrl = request.getRequestURI();
- response.sendRedirect(oauth.getAuthorizationUrl(null) +
+ response.sendRedirect(oauth.getAuthorizationUrl() +
"&state=" + state);
return false;
}