* @return auth request URI
*/
@Override
public String getEndUserAuthorizationRequestUri(final HttpServletRequest request) {
RequestToken requestToken;
try {
// The following does not work, leads to the following error from Twitter:
//String callbackUrl = getAbsoluteUrl(request, redirectUri);
//logger.log(Level.INFO, "Callback URL: {0}", callbackUrl);
//requestToken = twitter.getOAuthRequestToken(callbackUrl, "read");
/*
/* 401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
/* <?xml version="1.0" encoding="UTF-8"?>
/* <hash>
/* <error>Desktop applications only support the oauth_callback value 'oob'</error>
/* <request>/oauth/request_token</request>
/* </hash>
/*
/* Relevant discussions can be found on the Internet at:
/* http://www.google.co.jp/search?q=6c607809 or
/* http://www.google.co.jp/search?q=102175dd
/*
*/
requestToken = twitter.getOAuthRequestToken();
request.getSession().setAttribute("requestToken", requestToken);
// Workaround for requestToken.getAuthorizationURL() ignoring configuration built with ConfigurationBuilder
String authorizationUrl = twitter.getConfiguration().getOAuthAuthorizationURL().concat("?oauth_token=").concat(requestToken.getToken());
logger.log(Level.INFO, "Authorization request location URI: {0}", authorizationUrl);
return authorizationUrl;
} catch (TwitterException ex) {