ruby on rails - 'Validation failed - Client application can't be blank' using oauth-plugin and mongoid -
i'm new rails3 , ruby in general, may running issue ruby oauth-plugin itself. i'm attempting use consumer portion of logic authorize web app user's twitter account. setup point i'm redirected twitter authorization, when user redirected app, receive error when token being saved mongodb database:
mongoid::errors::validations in oauth consumerscontroller#callback validation failed - client application can't blank.
after stepping through framework code, can see token class expecting client_application_id have value, didn't think consumer token should associated clientapplication model?
one thing note i'm using latest branch of oauth-plugin includes fixes 3en mongoid, , way can models work using 'referenced_in' instead of 'embedded_in'. doing wrong here?
thanks in advance,
rob
application trace:
app/models/consumer_token.rb:25:in `find_or_create_from_access_token' app/controllers/oauth_consumers_controller.rb:16:in `callback'
partial full trace:
vendor/ruby/1.8/gems/mongoid-2.0.0.rc.7/lib/mongoid/persistence.rb: 234:in `fail_validate!' vendor/ruby/1.8/gems/mongoid-2.0.0.rc.7/lib/mongoid/persistence.rb: 75:in `save!' vendor/ruby/1.8/gems/mongoid-2.0.0.rc.7/lib/mongoid/relations/referenced/many.rb:90:in `create!' vendor/ruby/1.8/gems/simple_oauth-0.1.4/lib/simple_oauth/core_ext/object.rb:6:in `tap' vendor/ruby/1.8/gems/mongoid-2.0.0.rc.7/lib/mongoid/relations/referenced/many.rb:89:in `create!' app/models/consumer_token.rb:25:in `find_or_create_from_access_token' vendor/ruby/1.8/bundler/gems/oauth-plugin-f805e8c359b1/lib/oauth/models/consumers/token.rb:38:in `find_or_create_from_request_token' vendor/ruby/1.8/bundler/gems/oauth-plugin-f805e8c359b1/lib/oauth/controllers/consumer_controller.rb:35:in `callback' app/controllers/oauth_consumers_controller.rb:16:in `callback'``
it turns out followed docs incorrectly. user class incorrectly referencing wrong oauth class. starting scratch setup fixed issue.
Comments
Post a Comment