Facebook Integration not working?

  • 2.9.x
  • Operating system: Ubuntu 18.04
  • Browser: All

Trying to get Facebook integration working. followed all steps in docs, but repeatedly get this errorwhen trying to connect the app:

Has anyone seen this or have a solution?

Thanks

1 Like

At what state does this message occur?
Do you see anything inside your production log?

So to start with, I follow the instructions here step by step:
https://admin-docs.zammad.org/en/latest/channels-facebook.html

I note that there are some new options in the Client OAuth Settings in the Facebook config. Those that are not mentioned in the docs, I leave at their default (but make changes where the Zammad docs screenshots and instructions tell me to make a change from the defaults). I go ahead and proceed and make my app live in Facebook.

When I return to Zammad at this step:

Configure Zammad as Facebook app
Go to “Admin -> Channels -> Facebook”
Click on “Connect Facebook App” and enter your “App ID”, “App Secret” and verify the “Callback URL”.

I note that there is no option that reads Connect Facebook App, but as in the screenshot in the docs, there IS an option for Configure App. I was asked to do this earlier in the docs, but I open it again to double-check that my FB App ID & Secret match exactly what I have in the Facebook App, and the Callback URL is exactly what I entered in the Facebook App’s Valid OAuth Redirect URIs field.

The next part of the docs asks me to:

Click on “Add Account”, then you will see the authorize app page of Facebook. Click on “authorize app”.

I click on Add Account, and I am brought to the error that I posted above. When I click on the Okay button, I am brought to a Zammad 500 Error page:

/api/v1/external_credentials/facebook/callback?error_code=100&error_message=Invalid+Scopes%3A+publish_pages%2C+manage_pages.+This+message+is+only+shown+to+developers.+Users+of+your+app+will+ignore+these+permissions+if+present.+Please+read+the+documentation+for+valid+permissions+at%3A+https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Ffacebook-login%2Fpermissions&state=702233862291#_=_

My production log reads as follows:

I, [2019-03-18T11:28:58.402913 #1611-47041782684840]  INFO -- : Started GET "/api/v1/external_credentials/facebook/link_account" for 47.200.183.110 at 2019-03-18 11:28:58 +0000
I, [2019-03-18T11:28:58.409045 #1611-47041782684840]  INFO -- : Processing by ExternalCredentialsController#link_account as HTML
I, [2019-03-18T11:28:58.409109 #1611-47041782684840]  INFO -- :   Parameters: {"provider"=>"facebook"}
I, [2019-03-18T11:28:58.485194 #1611-47041782684840]  INFO -- : Redirected to https://www.facebook.com/dialog/oauth?client_id=408712946612391&redirect_uri=https%3A%2F%2Fhelp.culturediscovery.com%2Fapi%2Fv1%2Fexternal_credentials%2Ffacebook%2Fcallback&scope=publish_pages%2C+manage_pages&state=848084146028
I, [2019-03-18T11:28:58.488003 #1611-47041782684840]  INFO -- : Completed 302 Found in 79ms (ActiveRecord: 0.9ms)
I, [2019-03-18T11:29:01.653872 #1617-69939723127460]  INFO -- : execute Channel.fetch (try_count 0)...
I, [2019-03-18T11:29:01.655987 #1617-69939723127460]  INFO -- : fetching imap (imap-mail.outlook.com/info@culturediscovery.com port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false)
I, [2019-03-18T11:29:03.002153 #1617-69939723127460]  INFO -- :  - no message
I, [2019-03-18T11:29:03.002296 #1617-69939723127460]  INFO -- : done
I, [2019-03-18T11:29:04.283836 #1611-47041782685380]  INFO -- : Started GET "/api/v1/external_credentials/facebook/callback?error_code=100&error_message=Invalid+Scopes%3A+publish_pages%2C+manage_pages.+This+message+is+only+shown+to+developers.+Users+of+your+app+will+ignore+these+permissions+if+present.+Please+read+the+documentation+for+valid+permissions+at%3A+https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Ffacebook-login%2Fpermissions&state=848084146028" for 47.200.183.110 at 2019-03-18 11:29:04 +0000
I, [2019-03-18T11:29:04.292477 #1611-47041782685380]  INFO -- : Processing by ExternalCredentialsController#callback as HTML
I, [2019-03-18T11:29:04.292580 #1611-47041782685380]  INFO -- :   Parameters: {"error_code"=>"100", "error_message"=>"Invalid Scopes: publish_pages, manage_pages. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions", "state"=>"848084146028", "provider"=>"facebook"}
E, [2019-03-18T11:29:04.341750 #1611-47041782685380] ERROR -- : type: OAuthException, code: 100, message: Invalid verification code format. [HTTP 400] (Koala::Facebook::OAuthTokenRequestError)
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/koala-3.0.0/lib/koala/oauth.rb:312:in `fetch_token_string'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/koala-3.0.0/lib/koala/oauth.rb:258:in `get_token_from_server'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/koala-3.0.0/lib/koala/oauth.rb:160:in `get_access_token_info'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/koala-3.0.0/lib/koala/oauth.rb:176:in `get_access_token'
/opt/zammad/lib/external_credential/facebook.rb:49:in `link_account'
/opt/zammad/app/models/external_credential.rb:19:in `link_account'
/opt/zammad/app/controllers/external_credentials_controller.rb:41:in `callback'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/abstract_controller/base.rb:186:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/callbacks.rb:131:in `run_callbacks'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal/rescue.rb:20:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/notifications.rb:166:in `block in instrument'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/notifications.rb:166:in `instrument'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/railties/controller_runtime.rb:22:in `process_action'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/abstract_controller/base.rb:124:in `process'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.6.2/lib/action_view/rendering.rb:30:in `process'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal.rb:189:in `dispatch'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_controller/metal.rb:253:in `dispatch'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/routing/route_set.rb:31:in `serve'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/journey/router.rb:33:in `each'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/journey/router.rb:33:in `serve'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/routing/route_set.rb:844:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:192:in `call!'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/omniauth-1.9.0/lib/omniauth/builder.rb:64:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/etag.rb:25:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:25:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/head.rb:12:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/callbacks.rb:97:in `run_callbacks'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/callbacks.rb:24:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/rack/logger.rb:36:in `call_app'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/rack/logger.rb:24:in `block in call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/tagged_logging.rb:69:in `block in tagged'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/tagged_logging.rb:26:in `tagged'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/tagged_logging.rb:69:in `tagged'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/rack/logger.rb:24:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/request_id.rb:25:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/runtime.rb:22:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6.2/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/executor.rb:12:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6.2/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:522:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/configuration.rb:225:in `call'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:624:in `handle_request'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:438:in `process_client'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:302:in `block in run'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
I, [2019-03-18T11:29:04.342993 #1611-47041782685380]  INFO -- :   Rendering inline template
I, [2019-03-18T11:29:04.344106 #1611-47041782685380]  INFO -- :   Rendered inline template (0.9ms)
I, [2019-03-18T11:29:04.344443 #1611-47041782685380]  INFO -- : Completed 500 Internal Server Error in 52ms (Views: 1.6ms | ActiveRecord: 0.8ms)

Additional Notes & Observatons:
I did this last month on a preious Zammad install, and it worked flawlessly. In Googling on this topic, it seems that Facebook as made some API changes as of a week or so ago. I am wondering if these changes maybe broke this integration, and I am the first to notice?

I hope this is enough info to dig into this and either fix or lett me know where I am making a mistake.

Thanks again.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.