Merge "Remove unused OAuthToken in authorisation URL" into stable-2.10

This commit is contained in:
Saša Živkov
2015-03-26 12:33:17 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 15 deletions

View File

@@ -22,30 +22,21 @@ import java.io.IOException;
@ExtensionPoint
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

View File

@@ -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;
}