Help getting started with standalone proxy.

49 views
Skip to first unread message

Jason Huck

unread,
Jan 26, 2014, 3:57:11 PM1/26/14
to supertweet-...@googlegroups.com
- Installed the latest version on 64-bit CentOS 5.x, only to realize after the fact that it required Java 7, and the machine was running Java 6.

- Next tried installing the previously packaged version (from March 2013), only to realize that it wasn't updated to use https on API calls. (There must not be a compiled download of revision 11?)

- Updated the machine to Java 7 (OpenJDK, actually), and put the latest version (https://supertweet-twitter-api-oauth-proxy.googlecode.com/files/supertweet-local-dist-2013-11-25.tar.gz) back in place. I deleted the main supertweet directory as well as the .supertweet directory in the home folder  before doing so, and re-ran setup.sh afterwards, hoping that this would provide me with a "clean" install. It seemed to, as the App.properties file was reverted back to its default state.

- So, running from the November package (r12) on Java 7 (according to java -version), when I visit the setup page in a browser, I get the following error:

Server returned HTTP response code: 403 for URL: http://api.twitter.com/oauth/request_token - check the settings in /root/.supertweet/App.properties

Note the "http" (vs. "https") in the URL. /root/.supertweet/App.properties contains the correct info for my app. My best guess is that either the November/r12 download somehow doesn't contain the https change, or I'm somehow still running an older version, or the error message just doesn't reflect the actual URL being used.

Anyway, wondering what to try next? (Other than mail dead fish to Twitter HQ for suspending the Supertweet service.)

Thanks,
Jason



Mr Blog

unread,
Jan 27, 2014, 11:26:05 PM1/27/14
to supertweet-...@googlegroups.com
I don't think the current version requires Java 7 does it? That wasn't intended. It should be compatible with java 7 but we didn't intend to make it require Java 7. That should be filed as an issue/bug.

Given this latest situation with Twitter, we expect a lot more people using the stand-alone proxy now so we'll need to freshen the docs. It can be a battle to keep up with Twitter's app / dev center changes and documentation changes.

Check that App.properties file has your app's creds.

Also, it seems that Twitter no longer has the "PIN" mode for client auth, not sure there. But you can generate your own token for your own ID (same Twitter ID as the owner of the app); we will have to provide a new tool to add that access token manually.  In short you need to stop the server and create XML files with the content shown below (say using vi or similar text editor):

Where {screenname} is your Twitter screen name and {id} is your Twitter ID (numeric ID) - without the braces


$HOME/.supertweet/jos/ScreennameMap/{screenname}

<object-stream>
  <neoauth.model.ScreennameMap>
    <Screenname>{screenname}</Screenname>
    <id>{id}</id>
  </neoauth.model.ScreennameMap>
</object-stream>


$HOME/.supertweet/jos/UserInfo/{id}

<object-stream>
  <neoauth.model.UserInfo>
    <id>{id}</id>
    <screenName>{screenname}</screenName>
    <basicAuth>PASSWORD</basicAuth>
  </neoauth.model.UserInfo>
</object-stream>

$HOME/.supertweet/jos/Tokens/{id}

<object-stream>
  <neoauth.model.OAuthAccessToken>
    <UserId>{id}</UserId>
    <token>TOKEN</token>
    <tokenSecret>TOKEN-SECRET</tokenSecret>
  </neoauth.model.OAuthAccessToken>
</object-stream>


So to set up the app for that one user account, the owner of the Twitter app:

1. Edit App.properties

2. Log in to dev.twitter.com go to your app and Create Access Token if you haven't done so.

3. Create the three files as above with your screen name, twitter ID, basic auth password (whatever you want to use) and the Access Token values per step 2.

Then run.sh and you should be able to use the proxy with the one screen name at least.

Hope this helps, until we are able to refresh the docs and installation / setup process.

Jason Huck

unread,
Jan 28, 2014, 9:49:55 PM1/28/14
to supertweet-...@googlegroups.com
On Monday, January 27, 2014 11:26:05 PM UTC-5, Mr Blog wrote:
I don't think the current version requires Java 7 does it? That wasn't intended. It should be compatible with java 7 but we didn't intend to make it require Java 7. That should be filed as an issue/bug.

All I can tell you is that I got this error when trying to run it under Java 6:

java.lang.unsupportedclassversionerror unsupported major.minor version 51.0

I googled that, and found this page:


...which led me to believe Java 7 was required, and updating to Java 7 did allow the current version to run.

 

So to set up the app for that one user account, the owner of the Twitter app:

1. Edit App.properties

2. Log in to dev.twitter.com go to your app and Create Access Token if you haven't done so.

3. Create the three files as above with your screen name, twitter ID, basic auth password (whatever you want to use) and the Access Token values per step 2.

Then run.sh and you should be able to use the proxy with the one screen name at least.

Hope this helps, until we are able to refresh the docs and installation / setup process.

 
This is working for my own account. Now if only there were some way (since the setup process isn't working) for another account to authorize the app, I'd be back in business.


Thanks for the help, it is much appreciated!
Jason


Mr Blog

unread,
Jan 29, 2014, 12:48:55 AM1/29/14
to supertweet-...@googlegroups.com
Ok, we will look into the Java 6 issue.

In the mean time, we've updated the proxy to support the new OOB (out-of-band / PIN) mode.  So now the code works again to authenticate users, essentially as described in the docs.  There is a new WAR file.  Goole Code no longer allows us (or any Google Code hosted projects) to upload any additional files to the Downloads section, so now the downloads for the project are located at the following Google Drive url:


In your case, you really just need the new WAR file: supertweet-local.war

You want to stop the server (kill java task). Then copy the new WAR file over the old one: jetty-6.1.20/webapps/supertweet-local.war

Start the server again, with run.sh


1. set your app to desktop mode (by insuring you have no placeholder Callback URL specified) on dev.twiter.com

2. now follow the instructions as before, steps 7 and 8 http://www.supertweet.net/about/localproxy

or ie:

Setup your access token

Open the following page in your browser: http://localhost:8080/setup/access.

You will be prompted for a username and password. The default is admin/admin - you can change this by editing the $HOME/.supertweet/adminusers file and restarting the proxy.

Authenticate on Twitter.com

The http://localhost:8080/setup/access page will display a link to Twitter to sign in, along with a form where you enter a PIN and Password.

The link should open in a new window. Compete the sign-in and Twitter will return a PIN code. Enter this code into the form. Also enter the password that you want to use with the proxy (NOT your actual Twitter password - can be anything). This is the password your apps will use with Basic Auth.

Click "Submit" and the proxy should indicate that the credentials have been saved.

If you have the callback URL in your app settings on dev.twitter.com, you should get a PIN back instead of a failed attempt to open the callback url.

Jason Huck

unread,
Jan 29, 2014, 12:16:05 PM1/29/14
to supertweet-...@googlegroups.com
Thank you so much, this worked flawlessly!

Any particular recommendations for the best/preferred way to set this up to run as a service and start automatically on reboot on CentOS?

Thanks again,
Jason
Reply all
Reply to author
Forward
0 new messages