public String upgradeToken(HttpServletRequest request,
HttpServletResponse response) throws OAuthException, OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException {
OAuthConsumer consumer = (OAuthConsumer) request.getSession().getAttribute(DROPBOX_OAUTH_CONSUMER);
OAuthProvider provider = (OAuthProvider) request.getSession().getAttribute(DROPBOX_OAUTH_PROVIDER);
String verifier = request.getParameter("oauth_verifier");
provider.retrieveAccessToken(consumer, verifier);
Guest guest = AuthHelper.getGuest();
final Connector connector = Connector.getConnector("dropbox");
final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);
guestService.setApiKeyAttribute(apiKey, "accessToken", consumer.getToken());