Java – How to implement openId java web based application

javaopenid

In my web application i want to implement the OpenId just like stackoverflow.com have to login to its web-site.

In details you find while login to stackoverflow.com alt text

So when if one choose google then it allow the uses to log in through google account.

Please tell me how to implement it in java web application in details. Is there any single api for login through different website like(yahoo,google,facebook,etc)

Thanks

Best Answer

There is two sides of this:

  • client-side. This is the easier part. You can do this manually, but there are already javascript solutions that will render a list of openid providers. Check openid-selector and this jQuery plugin. I personally like the latter more.
  • server-side. You will have to handle openId authentication. There are multiple java libraries (they are all listed on the openid website). Here is one that I decided to use: openid4java. See this question for my motivation.