使用 Spring Security 对 Facebook 用户进行身份验证
我正在使用 Spring Security 3.0.x,我希望我的用户使用 OpenId 和 Facebook 进行身份验证。目前我已经让 OpenId 部分正常工作,但我对用户如何使用 Facebook 登录感到困惑。我读过有关Spring安全性的 OAuth ,但就像我明白,它只适合访问资源。示例应用程序使用用户名和密码进行身份验证。
所以我的问题是,如何使用 Spring security 对 Facebook 的用户进行身份验证?
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.
So my question is, how do I authenticate users with Facebook using Spring security?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
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.
我创建了一个名为 spring-security-social for Facebook 的新项目,它提供了基于身份验证过滤器的在 spring-security-oauth 上。与 spring-security-facebook 不同,它由 acoveo softwaredevelopment 积极维护,并基于新的 spring-security-oauth 版本构建。
I have created a new project called spring-security-social for Facebook, which provides an authentication filter based on spring-security-oauth. As opposed to spring-security-facebook, it is actively maintained by acoveo software development and builts upon the new spring-security-oauth release.
您还可以使用 https://github.com/pac4j/spring-security-pac4j它支持 OAuth(Facebook、Twitter、Google...)、CAS、SAML、OpenID(Connect)和 GAE。请参阅演示: https://github.com/pac4j/spring-security-pac4j-demo
You can also use https://github.com/pac4j/spring-security-pac4j which supports OAuth (Facebook, Twitter, Google...), CAS, SAML, OpenID (Connect) and GAE. See the demo: https://github.com/pac4j/spring-security-pac4j-demo