views:

1566

answers:

4

I want to use OpenID in my Java Google App Engine web application but I don't know where to start...

I have looked at openid4java and joid.

openid4java says you have to place some libraries on the "endorsed libraries"-path. I don't have one locally on my computer, and I sure don't know how to do that on Google App Engine.

joid looks simple enough but doesn't look up to date or something because I get a HTTP 400 back from Google when I try to get an authentication.

Any pointers?

+3  A: 

It should be pretty easy to translate http://appengine-cookbook.appspot.com/recipe/accept-google-aol-yahoo-myspace-facebook-and-openid-logins/ (which provides a Python app engine way to do it) into app engine Java, if going through rpxnow.com is OK with you. If parsing json is a problem you can also request xml results from rpxnow.com. See https://rpxnow.com/docs for more about the RPX API.

Alex Martelli
This link is great. Thanks Alex!
David Underhill
+1  A: 

For the openidjava libraries you would just include this in your project. If you are using Eclipse (it has a great plug-in for GWT and App Engine). Stick the openidjava files in your src directory or the jar in the WEB-INF/lib directory and make sure you add it to your classpath.

classpath or buildpath? because I have the libraries on the buildPath but get exceptions regarding some XML Security when trying to instanciate the ConsumerManager
Rikard
After checking out the latest openid4java and building a new jar it works.
Rikard
+2  A: 

http://code.google.com/p/dyuproject/

A: 

Well, I know this is an old question, but I'm trying now to get openid4java running on App Engine and it is not working. It seems that it uses an "HTTPClient" library that wants to start a new thread and App Engine throws an exception because of that.

So, if you plan to use openid4java on App Engine, look before if there is a solution to this. I just can't find one :(

You can see the problem in more detail here and here.

Hope it helps!

Damian
Apparently, this has been fixed recently in svn by making the HTTP client code openid4java uses "pluggable". See http://opensource.bamboo.atlassian.com/browse/OPENID-OPENID4JAVA-338/commit
Jérémie Koenig