// redirect user to Google Authorization URI.
return Response.seeOther(UriBuilder.fromUri(googleAuthURI).build()).build();
}
// We have already an access token. Query the data from Google API.
final Client client = SimpleOAuthService.getFlow().getAuthorizedClient();
final AllTaskListsModel allTaskListsModel = getTasks(client);
return Response.ok(allTaskListsModel).type(MediaType.TEXT_HTML_TYPE).build();
}