【问题标题】:Grails Facebook Authentication plugin error after redirect重定向后的 Grails Facebook 身份验证插件错误
【发布时间】:2015-09-24 16:12:40
【问题描述】:

我在 Spring Security (2.0-RC5) 中使用 Facebook Authentication plugin (0.17)。

我已经包含了那里询问的所有内容,并按照示例创建了我的服务以获取登录的用户数据(来自 Facebook)。 在example app FacebookAuthService(我已经完全复制到我的应用程序)中有一个“FacebookUser create()”函数。 与 Facebook 连接并重定向回我的应用程序(打开 stac)后,我得到:

    | Error 2015-07-07 12:55:47,567 [http-bio-8080-exec-10] ERROR [/bicycles-new].[default]  - Servlet.service() for servlet [default] in context with path [/bicycles-new] threw exception [Filter execution threw an exception] with root cause
Message: org.apache.http.impl.client.HttpClients
    Line | Method
->>  366 | run                   in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    355 | run                   in     ''
|    354 | findClass . . . . . . in java.net.URLClassLoader
|    425 | loadClass             in java.lang.ClassLoader
|     52 | create . . . . . . .  in FacebookAuthService
|    113 | create                in com.the6hours.grails.springsecurity.facebook.DefaultFacebookAuthDao
|     72 | authenticate . . . .  in com.the6hours.grails.springsecurity.facebook.FacebookAuthProvider
|     58 | attemptAuthentication in com.the6hours.grails.springsecurity.facebook.FacebookAuthRedirectFilter
|     46 | doFilter . . . . . .  in     ''
|     62 | doFilter              in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
|   1145 | runWorker . . . . . . in java.util.concurrent.ThreadPoolExecutor
|    615 | run                   in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run . . . . . . . . . in java.lang.Thread

代码行是

Facebook facebook = new FacebookTemplate(token.accessToken.accessToken)

创建对象时抛出错误。 如果我在这里做错了什么,我将不胜感激。

【问题讨论】:

  • 将有助于查看更详细的堆栈跟踪。尝试使用--stacktrace 选项运行应用程序
  • 我已经编辑了我的问题 - 现在堆栈跟踪出现错误
  • 我猜你需要将 Apache HttpClient 添加到你的类路径
  • 猜得好。我在我的 BuildConfig.groovy 中添加了 compile compile 'org.apache.httpcomponents:httpclient:jar:4.5' 到依赖项。奇迹般有效!你能把它作为一个答案,所以我可以接受吗,伊戈尔?非常感谢! :)

标签: grails groovy spring-security facebook-authentication


【解决方案1】:

您需要将 Apache HttpClient 添加到您的依赖项中:

compile 'org.apache.httpcomponents:httpclient:4.5'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-08
    • 1970-01-01
    • 2019-01-27
    相关资源
    最近更新 更多