How do I implement an OpenID consumer in my Google

2020-06-01 03:31发布

问题:

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?

回答1:

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



回答2:

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.



回答3:

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.



回答4:

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!