使用Spring Security对Facebook进行身份验证

问题描述:

我正在使用Spring Security 3.0.x,我希望我的用户使用OpenId和Facebook进行身份验证。目前我的OpenId部分正在运行,但我对用户如何使用Facebook登录感到困惑。我已经阅读了有关Spring安全性的 OAuth ,但是我不记得,它只对访问资源有好处。示例应用程序使用用户名和密码进行身份验证。

I'm using Spring Security 3.0.x and I'd like my users to authenticate using OpenId and Facebook. Currently I've got the OpenId-part working, but I'm confused about how users can login with Facebook. I've read about the OAuth for Spring security, but as fas as I undestand, it is only good for accessing resources. The example applications authenticate with username and password.

所以我的问题是,如何使用Spring安全性对Facebook用户进行身份验证?

So my question is, how do I authenticate users with Facebook using Spring security?

Spring Security没有解决这个问题(截至目前)。查看 Spring Social ,它旨在将您的应用程序连接到Facebook,Twitter等。还可以查看这篇博文,他们整合了Spring Social和Spring Security。

Spring Security doesn't address this (as of yet). Check out Spring Social which is designed to connect your app to Facebook, Twitter, etc. Also check out this blog post, where they have integrated Spring Social and Spring Security.