问题
Is there an openID implementation in Java? I would like to use this in a tomcat application.
回答1:
The openid4java library seems to be the most popular.
回答2:
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.
回答3:
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.
回答4:
Spring Security provides an OpenID authentication method too
回答5:
If you don't mind using a service there is RPX
回答6:
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.
来源:https://stackoverflow.com/questions/376561/openid-java