checkError(request);
if (uri.contains(Constants.OAUTH_VERIFIER)) {
final RequestToken rtoken = (RequestToken) PlayAuthenticate
.removeFromCache(context.session(), CACHE_TOKEN);
final String verifier = request.getQueryString(Constants.OAUTH_VERIFIER);
try {
final RequestToken response = service
.retrieveAccessToken(rtoken, verifier);
final I i = buildInfo(response);
return transform(i);
} catch (RuntimeException ex) {
throw new AuthException(ex
.getLocalizedMessage());
}
} else {
final String callbackURL = getRedirectUrl(request);
try {
final RequestToken response = service
.retrieveRequestToken(callbackURL);
// All good, we have the request token
final String token = response.token;
final String redirectUrl = service.redirectUrl(token);