Uploaded image for project: 'Spring Social Facebook'
  1. Spring Social Facebook
  2. SOCIALFB-203

Insufficient permission - Unable to post to Facebook

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0.3.RELEASE
    • Fix Version/s: None
    • Component/s: API Binding
    • Labels:
      None

      Description

      Getting insufficient permission when posting to user timeline. No idea if this change has to do with recent changes Facebook have made to the api (removing 'publish_action' scope param amongst other changes). 

      According to docs, publish_actions scope has been replaced by Share Dialog and suggest using that instead. Not sure if Spring Social is yet to support this?

      Facebook connection response:

      {{2018-08-26 14:33:21,962 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:113] Facebook error: 2018-08-26 14:33:21,962 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:114] CODE : 200 2018-08-26 14:33:21,963 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:115] TYPE : OAuthException 2018-08-26 14:33:21,963 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:116] SUBCODE : null 2018-08-26 14:33:21,963 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:117] MESSAGE : (#200) Requires either publish_to_groups permission and app being installed in the group, or manage_pages and publish_pages as an admin with sufficient administrative permission 2018-08-26 14:33:21,963 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:118] USER TITLE : null 2018-08-26 14:33:21,963 DEBUG [http-nio-8080-exec-7] o.s.s.f.a.i.FacebookErrorHandler [FacebookErrorHandler.java:119] USER MESSAGE: null 2018-08-26 14:33:21,966 DEBUG [http-nio-8080-exec-7] o.a.h.i.c.PoolingHttpClientConnectionManager [PoolingHttpClientConnectionManager.java:341] Connection [id: 2][route:
      {s}
      ->https://graph.facebook.com:443] can be kept alive indefinitely 2018-08-26 14:33:21,966 DEBUG [http-nio-8080-exec-7] o.a.h.i.c.DefaultManagedHttpClientConnection [LoggingManagedHttpClientConnection.java:88] http-outgoing-2: set socket timeout to 0 2018-08-26 14:33:21,966 DEBUG [http-nio-8080-exec-7] o.a.h.i.c.PoolingHttpClientConnectionManager [PoolingHttpClientConnectionManager.java:348] Connection released: [id: 2][route: {s}
      ->https://graph.facebook.com:443[total|https://graph.facebook.com:443][total/] kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10] 2018-08-26 14:33:21,970 DEBUG [http-nio-8080-exec-7] o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver [AbstractHandlerExceptionResolver.java:137] Resolving exception from handler [public java.lang.String com.projectx.controller.MessageController.tweetPost(com.projectx.model.message.Tweet,javax.servlet.http.Part,java.security.Principal,javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,java.util.Locale)]: org.springframework.social.InsufficientPermissionException: Insufficient permission for this operation. 2018-08-26 14:33:21,971 DEBUG [http-nio-8080-exec-7] o.s.w.s.m.a.ResponseStatusExceptionResolver [AbstractHandlerExceptionResolver.java:137] Resolving exception from handler [public java.lang.String com.projectx.controller.MessageController.tweetPost(com.projectx.model.message.Tweet,javax.servlet.http.Part,java.security.Principal,javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,java.util.Locale)]: org.springframework.social.InsufficientPermissionException: Insufficient permission for this operation. 2018-08-26 14:33:21,972 DEBUG [http-nio-8080-exec-7] o.s.w.s.m.s.DefaultHandlerExceptionResolver [AbstractHandlerExceptionResolver.java:137] Resolving exception from handler [public java.lang.String com.projectx.controller.MessageController.tweetPost(com.projectx.model.message.Tweet,javax.servlet.http.Part,java.security.Principal,javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,java.util.Locale)]: org.springframework.social.InsufficientPermissionException: Insufficient permission for this operation. 2018-08-26 14:33:21,973 DEBUG [http-nio-8080-exec-7] o.s.d.n.w.s.OpenSessionInViewInterceptor [OpenSessionInViewInterceptor.java:133] Closed Neo4j OGM Session in OpenSessionInViewInterceptor 2018-08-26 14:33:21,973 DEBUG [http-nio-8080-exec-7] o.s.w.s.DispatcherServlet [FrameworkServlet.java:997] Could not complete request org.springframework.social.InsufficientPermissionException: Insufficient permission for this operation. at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleFacebookError(FacebookErrorHandler.java:77) at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleError(FacebookErrorHandler.java:59) at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:773) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:726) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:700) at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:455) at org.springframework.social.facebook.api.impl.FacebookTemplate.publish(FacebookTemplate.java:319) at org.springframework.social.facebook.api.impl.FeedTemplate.post(FeedTemplate.java:185) at org.springframework.social.facebook.api.impl.FeedTemplate.updateStatus(FeedTemplate.java:161) at com.projectx.service.busines.MessageTemplate.checkFacebookSend(MessageTemplate.java:479) at com.projectx.service.busines.MessageTemplate.handleSocialPost(MessageTemplate.java:236) at com.projectx.service.busines.MessageTemplate.handleMessage(MessageTemplate.java:215) at com.projectx.controller.MessageController.processPost(MessageController.java:282) at com.projectx.controller.MessageController.tweetPost(MessageController.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:870) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:185) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:158) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:155) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at com.projectx.filter.CustomAppFilter.doFilter(CustomAppFilter.java:31) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)}}
      

       

        Attachments

          Activity

            People

            Assignee:
            habuma Craig Walls
            Reporter:
            holden_1 Holden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: