OpenID, Google App Engine, and Yahoo

Posted: November 23, 2009

If you want to use OpenID with Google App Engine / Java, try this library: dyuproject

It includes a standard Servlet Filter that restricts access to the URL prefix you specify. It also uses an internal HTTP library that is GAE compliant.

I was able to get it working with my app in about 30 minutes. For Google that is. Yahoo was a different matter.

The behavior I experienced when specifying http://yahoo.com/ as my provider identifier is that I was continuously redirected back to the login page.

To fix this, you need to create a properties file. The author has an example file that worked for me. I'm using maven so I put the file in: src/main/resources/identifier_select.properties:

providers = google,yahoo

# the identifiers must be normalized
google.openid_server = https://www.google.com/accounts/o8/ud
google.identifier.0 = https://google.com/accounts/o8/id
google.identifier.1 = https://www.google.com/accounts/o8/id
google.identifier.2 = http://www.google.com/
google.identifier.3 = http://google.com/

yahoo.openid_server = https://open.login.yahooapis.com/openid/op/auth
yahoo.identifier.0 = http://www.yahoo.com/
yahoo.identifier.1 = http://yahoo.com/

Creating this file fixed my issues. Google, Yahoo, and Claim ID are all working correctly!