简体   繁体   中英

How to implement openId java web based application?

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 替代文字

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

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.

Not quite. Most of the ones you have mentioned simply use the OpenID protocol, however Facebook uses its own authorisation, so you would need to add that as a separate method.

Take a look at OpenID4Java

I have also used the openid-selector for the client side part.

Finally, I would take a look at the this resource to see the URL endpoints for the different providers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM