[Facebooker-talk] Facebooker::Session::IncorrectSignature exception when adding application

Xue Wei li xu3w31l1 at gmail.com
Mon Jul 21 12:03:18 EDT 2008


Whenever a user adds my application Facebooker will throw a
Facebooker::Session::IncorrectSignature exception. Upon further
investigation I was finding that while the expected signature was blank, the
actual signature was the facebook app secret key. why is this happening?

Processing FacebookGroupsController#index (for 127.0.0.1 at 2008-07-21
08:58:34) [GET]
  Session ID: hfiauwhfiuwafwfhuiwhf
  Parameters: {"action"=>"index", "installed"=>"1",
"controller"=>"facebook_groups", "auth_token"=>"afewagwgawgwefawefwefawefw"}


Facebooker::Session::IncorrectSignature
(Facebooker::Session::IncorrectSignature):
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:110:in
`verify_signature'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:95:in
`verified_facebook_params'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:35:in
`facebook_params'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:45:in
`valid_session_key_in_session?'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:41:in
`session_already_secured?'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:26:in
`set_facebook_session'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:176:in
`ensure_authenticated_to_facebook'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:181:in
`ensure_application_is_installed_by_facebook_user'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in
`send'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in
`evaluate_method'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161:in
`call'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:430:in
`call'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:592:in
`run_before_filters'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:578:in
`call_filters'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in
`perform_action_without_benchmark'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
  /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in
`perform_action_without_caching'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in
`perform_action'

/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'

/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in
`cache'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in
`perform_action'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in
`send'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in
`process_without_filters'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in
`process_without_session_management_support'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in
`process'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in
`process'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in
`handle_request'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in
`dispatch'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in
`synchronize'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in
`dispatch'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in
`dispatch_cgi'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in
`dispatch'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in
`process'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`synchronize'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`process'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
`process_client'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`each'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`process_client'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`initialize'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`new'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`initialize'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`new'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`run'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in
`run'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`each'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
`run'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in
`load'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in
`load'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
`new_constants_in'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in
`load'

/opt/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/mongrel.rb:64
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`require'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
`new_constants_in'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'
  /opt/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
  script/server:3


If I account for the signature to be blank on install, I get a
SignatureTooOld exception; since facebook_sig_params['time'] is an empty
value

acebooker::Session::SignatureTooOld (Facebooker::Session::SignatureTooOld):
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:112:in
`verify_signature'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:95:in
`verified_facebook_params'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:35:in
`facebook_params'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:45:in
`valid_session_key_in_session?'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:41:in
`session_already_secured?'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:26:in
`set_facebook_session'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:176:in
`ensure_authenticated_to_facebook'
  /vendor/plugins/facebooker/lib/facebooker/rails/controller.rb:181:in
`ensure_application_is_installed_by_facebook_user'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in
`send'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173:in
`evaluate_method'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161:in
`call'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:430:in
`call'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:592:in
`run_before_filters'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:578:in
`call_filters'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in
`perform_action_without_benchmark'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
  /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in
`perform_action_without_caching'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in
`perform_action'

/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'

/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in
`cache'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in
`perform_action'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in
`send'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in
`process_without_filters'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in
`process_without_session_management_support'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in
`process'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in
`process'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in
`handle_request'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in
`dispatch'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in
`synchronize'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in
`dispatch'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in
`dispatch_cgi'

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in
`dispatch'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in
`process'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`synchronize'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`process'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
`process_client'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`each'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`process_client'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`initialize'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`new'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`initialize'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`new'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`run'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in
`run'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`each'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
`run'

/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in
`run'
  /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in
`load'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in
`load'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
`new_constants_in'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in
`load'

/opt/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/mongrel.rb:64
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`require'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
`new_constants_in'

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'
  /opt/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
  /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
  script/server:3


When I account for both the session and the signature, I get a "You've
already installed this application" message from Facebook

Processing FacebookGroupsController#index (for 127.0.0.1 at 2008-07-21
08:52:35) [GET]
  Session ID: cfb49392aw667c9f45fwefwef
  Parameters: {"action"=>"index", "installed"=>"1",
"controller"=>"facebook_groups",
"auth_token"=>"e4awa52fweafweafwcb79f1438afwegagw3"}
Redirected to
http://www.facebook.com/install.php?api_key=92b0f6e88wafawgwgwawafwffawf01&v=1.0&next=%2Ffacebook_groups%2Findex%3Finstalled%3D1%26
Filter chain halted as [:ensure_application_is_installed_by_facebook_user]
rendered_or_redirected.
Completed in 0.25199 (3 reqs/sec) | DB: 0.01752 (6%) | 302 Found [
http://xxxxx.com/?auth_token=e44bf8c2a524f0fwafwagwaegaweawe&installed=1]

I'm running on rails 2.1 ruby 1.86, but this has also happened on rails 2.0
and pre-2.0 versions.

Thanks in advance to anyone that can help - I'm at a complete loss.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080721/72a14a98/attachment-0001.html>


More information about the Facebooker-talk mailing list