5

我可以知道是否有任何关于 Spring Security 与 facebook connect 集成的教程/指南

4

5 回答 5

7

Springsource 的人推出了“Spring Social”,在处理任何社交 API(包括 facebook)时都值得关注。见http://www.springsource.org/spring-social

于 2010-12-06T02:47:50.173 回答
2

Spring Social 很棒,但仅适用于 Spring Framework 3.0+。所以请注意您的春季版本,因为我尝试了两天来弄清楚如何使 Spring Social 与 Spring Framework 2.5 一起工作;)

于 2011-04-11T19:16:56.043 回答
1

也许你应该看看OAuth for Spring Security and Authentication - Facebook Developers

于 2010-09-30T07:12:59.653 回答
1

除了 Spring 安全性之外,您还需要Spring social,请参阅使用服务提供商帐户登录。一篇很有前途的博客文章是Integrating your Java Spring MVC webapp with Facebook – Part 1: Doing the OAuth Dance

于 2012-04-02T06:07:33.817 回答
0

您可以使用 facbook graph api 来请求用户信息,然后像这样解析它:

        JSONObject resp = new JSONObject(content);
        String facebookid = resp.getString("id");
        String firstName = resp.getString("first_name");
        String lastName = resp.getString("last_name");
        String email = resp.getString("email");
        String phone = resp.getString("mobile_phone");

        JSONObject address = resp.getJSONObject("address");
        String street = address.getString("street");
        String city = address.getString("city");
        String zip = address.getString("zip");
        String state = address.getString("state");
        String country = address.getString("country");

在你有调用你的注册方法的字符串之后应该很容易。比你只需要自动验证它们。

我在此处发布了有关此内容的更多详细信息: JSP (tomcat) 中的 Facebook Connect 示例

于 2011-06-25T23:02:48.523 回答