34

Is there an openID implementation in Java? I would like to use this in a tomcat application.

6 Answers 6

24

The openid4java library seems to be the most popular.

17

The only one I have looked into is OpenID4Java by there is are more options listed on at http://wiki.openid.net/Libraries.

I recommend looking at Using OpenID on TheServerSide.COM for a good introduction with some valuable code snippets.

At the moment I am leaning towards implementing the authentication and authorization in the web tier using mod_auth_openid. But still make my application an authentication provider for people who don't want to know they are using OpenID.

0
10

I've been searching for this myself as well. Here are my findings:

  • OpenId4Java does not run on Google App Engine. It spawns new threads
  • JOpenId does not do discovery and I have some doubts it is does DH-1 or DH-256 to establish an association.

I have not found a general java openid 2.0 provider yet that I can use on GAE.

1
9

Spring Security provides an OpenID authentication method too

1
  • 2
    which is based still on openid4java
    – stivlo
    Dec 12, 2011 at 15:32
4

If you don't mind using a service there is RPX

1
  • RPX saved me!! I struggled for days to implement all of the features necessary to get OpenID to work. In the end I still couldn't get it to work. I'm using RPX now and it only took a few hours to get up and running. Oct 6, 2009 at 23:08
2

I am currently using Openid4Java in a Grails application in Tomcat and it works quite well. There's a few issues with the (very old) binary that is on the download site code.sxip.com, namely that it doesn't work at all with Yahoo or myopenid.com implementations. If you want to use it you can find a binary on the projects Google groups, or get the source code from the Subversion repository and built it from there. It's quite trivial, basically just an ant script you need to run.

1
  • Another issue I ran into was that I needed to setEnforceRpId(false) on the ConsumerManager to make it work when developing on localhost.
    – stian
    Dec 31, 2008 at 13:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.