facebooker2
facebooker2 copied to clipboard
current_facebook_user get error "This authorization code has been used."
Hi All
I can login using facebooker2, and on my home page I use current_facebook_user but I get error "This authorization code has been used." Mogli::Client::OAuthException.
a few month ago it doesn't happen.
any body can help me?
What are you storing? Once you use the oauth code to get a facebook session, you need to store the session info and discard the token.
Mike
On Dec 10, 2012, at 4:12 AM, derri [email protected] wrote:
Hi All
I can login using facebooker2, and on my home page I use current_facebook_user but I get error "This authorization code has been used." Mogli::Client::OAuthException.
a few month ago it doesn't happen.
any body can help me?
— Reply to this email directly or view it on GitHub.
Hey Mike, This is the same error I am getting. I think it's because Facebook changed some stuff recently. This is my stack trace that I posted on Mogli.
/Users/alexandrecarriere/.bundler/ruby/1.8/mogli-b8f68b5d7e44/lib/mogli/client.rb:79:in `raise_error_by_type_and_message'
/Users/alexandrecarriere/.bundler/ruby/1.8/mogli-b8f68b5d7e44/lib/mogli/client.rb:70:in `raise_client_exception'
/Users/alexandrecarriere/.bundler/ruby/1.8/mogli-b8f68b5d7e44/lib/mogli/client.rb:52:in `create_from_code_and_authenticator'
/Users/alexandrecarriere/.bundler/ruby/1.8/facebooker2-504cc261af61/lib/facebooker2/rails/controller.rb:231:in `oauth2_fetch_client_and_user_from_cookie'
/Users/alexandrecarriere/.bundler/ruby/1.8/facebooker2-504cc261af61/lib/facebooker2/rails/controller.rb:221:in `oauth2_fetch_client_and_user'
/Users/alexandrecarriere/.bundler/ruby/1.8/facebooker2-504cc261af61/lib/facebooker2/rails/controller.rb:16:in `current_facebook_user'
app/controllers/application_controller.rb:31:in `current_user'
app/controllers/users_controller.rb:28:in `show'
Hi Mike for until a few month ago it still work, i can login and i can fetch current_facebook_user, now i just can login but can't fetch current_facebook_user, i try to remove fbsr cookies but it just remove the cookie and still can't fetch current_faebook_user.
I just add facebooker2 and authlogic_facebook_connect together. it's work before.
You should be able to get it once per login. Once you exchange the auth code for a token, you'll need to store the token and rebuild the user from that.
Mike
On Dec 10, 2012, at 7:56 PM, derri [email protected] wrote:
Hi Mike for until a few month ago it still work, i can login and i can fetch current_facebook_user, now i just can login but can't fetch current_facebook_user, i try to remove fbsr cookies but it just remove the cookie and still can't fetch current_faebook_user.
I just add facebooker2 and authlogic_facebook_connect together. it's work before.
— Reply to this email directly or view it on GitHub.
Same problem form me
mogli (0.0.36) lib/mogli/client.rb:79:in raise_error_by_type_and_message' mogli (0.0.36) lib/mogli/client.rb:70:in
raise_client_exception'
mogli (0.0.36) lib/mogli/client.rb:52:in create_from_code_and_authenticator' (eval):2:in
send'
(eval):2:in current_facebook_user' app/views/layouts/_menu_user_right.html.erb:8 /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in
render'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in
render'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in render_partial' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in
trace_execution_scoped'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in render_partial' app/views/layouts/_menu.html.erb:21 /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in
render'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in
render'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in render_partial' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in
trace_execution_scoped'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in render_partial' app/views/layouts/home.html.erb:56 /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in
render'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in
render'
app/controllers/pages_controller.rb:143:in home' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:in
perform_action'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:248:in
perform_action'
warden (0.10.7) lib/warden/manager.rb:35:in call' warden (0.10.7) lib/warden/manager.rb:35:in
call'
warden (0.10.7) lib/warden/manager.rb:34:in catch' warden (0.10.7) lib/warden/manager.rb:34:in
call'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/rack/browser_monitoring.rb:18:in call' devise (1.0.11) lib/devise/rails/warden_compat.rb:43:in
call'
How can i solve?
I just pushed a completely untested change that should cache the required info. Can you try running with the facebooker2 from git to see if that fixes things?
I install it as plugin,this is what I get:
ActionView::TemplateError (Constant Facebooker2::Rails::Controller::Moglie from facebooker2/rails/controller/moglie.rb not found Constant Facebooker2::Rails::Moglie from facebooker2/rails/moglie.rb not found Constant Facebooker2::Moglie from facebooker2/moglie.rb not found Constant Moglie from moglie.rb not found) on line #17 of themes/dappled/views/shared/_user_menu.html.haml:
I just fixed the type. Can you try again?
Mike
On Dec 12, 2012, at 10:36 AM, derri [email protected] wrote:
I install it as plugin,this is what I get:
ActionView::TemplateError (Constant Facebooker2::Rails::Controller::Moglie from facebooker2/rails/controller/moglie.rb not found Constant Facebooker2::Rails::Moglie from facebooker2/rails/moglie.rb not found Constant Facebooker2::Moglie from facebooker2/moglie.rb not found Constant Moglie from moglie.rb not found) on line #17 of themes/dappled/views/shared/_user_menu.html.haml:
— Reply to this email directly or view it on GitHub.
I get this : undefined method `sign_in_user_and_client' for #BaseController:0xc2ee850
there a typo lib/facebooker2/rails/controller.rb line 234
if i change it to fb_sign_in_user_and_client it's work fine
i'm sorry when I try to logout and try to sign in again, this i what I get:
Mogli::Client::OAuthException (Error validating access token: The session is invalid because the user logged out.):
I added an fb_logout! method that you can call when that error is raised. You should be able to call that and then go through the login process.
Mike
On Dec 12, 2012, at 10:51 AM, derri [email protected] wrote:
i'm sorry when I try to logout and try to sign in again, this i what I get:
Mogli::Client::OAuthException (Error validating access token: The session is invalid because the user logged out.):
— Reply to this email directly or view it on GitHub.
It's work for now, I'll check it again tomorrow
Thanks Mike