Allen Walker
2008-Aug-14 23:36 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
If someone isn''t logged in this filter works - it takes them to the facebook login page. However after logging in it''s going to my root application URL outside of facebook. How do I set the proper redirect URL after a user logs into facebook? thanks
Richard Jordan
2008-Aug-15 15:28 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
I use a before_filter thrown on a facebook auth_token. Here is the code. ===================================================== # when a user authenticates to facebook this before filter redirects # the user back to a fbml canvas page instead of to html on our server. before_filter :redirect_if_auth_key # keeps the user inside facebook def redirect_if_auth_key if( params[:auth_token]) redirect_to( url_for(:action => "whateveryouwant", :canvas => true, :only_path => false)) end end ===================================================== Try the filter in your app/controller/application.rb. Richard On Thu, 14 Aug 2008, Allen Walker wrote:> If someone isn''t logged in this filter works - it takes them to the facebook > login page. However after logging in it''s going to my root application URL > outside of facebook. How do I set the proper redirect URL after a user logs > into facebook? > > thanks > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >
David Clements
2008-Aug-15 15:42 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
I think this is because you have your callback url as the post add url. If you make the post add url a canvas page you won''t see this behavior. Dave On Fri, Aug 15, 2008 at 9:28 AM, Richard Jordan <jordanr at cs.washington.edu>wrote:> I use a before_filter thrown on a facebook auth_token. Here is the code. > =====================================================> # when a user authenticates to facebook this before filter redirects > # the user back to a fbml canvas page instead of to html on our server. > before_filter :redirect_if_auth_key > > # keeps the user inside facebook > def redirect_if_auth_key > if( params[:auth_token]) > redirect_to( url_for(:action => "whateveryouwant", > :canvas => true, :only_path => false)) > end > end > =====================================================> > Try the filter in your app/controller/application.rb. > > Richard > > > On Thu, 14 Aug 2008, Allen Walker wrote: > > If someone isn''t logged in this filter works - it takes them to the >> facebook login page. However after logging in it''s going to my root >> application URL outside of facebook. How do I set the proper redirect URL >> after a user logs into facebook? >> >> thanks >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080815/ed5bb1b6/attachment.html>
True, you can set post add/authorise URL''s, but these are static. Is this what you want, or is there good a way to let a user continue an action post add/authorise ? i.e. 1. click a link to do ''something'' 2. add/authorise the application 3. continue on with the action requested in 1 David Clements wrote:> I think this is because you have your callback url as the post add > url. If you make the post add url a canvas page you won''t see this > behavior. > > Dave > > > On Fri, Aug 15, 2008 at 9:28 AM, Richard Jordan > <jordanr at cs.washington.edu <mailto:jordanr at cs.washington.edu>> wrote: > > I use a before_filter thrown on a facebook auth_token. Here is > the code. =====================================================> # when a user authenticates to facebook this before filter redirects > # the user back to a fbml canvas page instead of to html on our > server. > before_filter :redirect_if_auth_key > > # keeps the user inside facebook > def redirect_if_auth_key > if( params[:auth_token]) > redirect_to( url_for(:action => "whateveryouwant", > :canvas => true, :only_path => false)) > end > end > =====================================================> > Try the filter in your app/controller/application.rb. > > Richard > > > On Thu, 14 Aug 2008, Allen Walker wrote: > > If someone isn''t logged in this filter works - it takes them > to the facebook login page. However after logging in it''s > going to my root application URL outside of facebook. How do I > set the proper redirect URL after a user logs into facebook? > > thanks > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > <mailto:Facebooker-talk at rubyforge.org> > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org <mailto:Facebooker-talk at rubyforge.org> > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > ------------------------------------------------------------------------ > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >
David Clements
2008-Aug-15 15:58 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
Yes, You can overide the install url in your application.rb by doing something like this: def application_is_not_installed_by_facebook_user redirect_to acebook_session.install_url(:next => next_path() ) end Then define next path as a relative part of a canvas url. Dave On Fri, Aug 15, 2008 at 9:54 AM, dara <dara at catch.fm> wrote:> True, you can set post add/authorise URL''s, but these are static. > > Is this what you want, or is there good a way to let a user continue an > action post add/authorise ? > > i.e. > > 1. click a link to do ''something'' > 2. add/authorise the application > 3. continue on with the action requested in 1 > > > David Clements wrote: > >> I think this is because you have your callback url as the post add url. >> If you make the post add url a canvas page you won''t see this behavior. >> >> Dave >> >> >> On Fri, Aug 15, 2008 at 9:28 AM, Richard Jordan < >> jordanr at cs.washington.edu <mailto:jordanr at cs.washington.edu>> wrote: >> >> I use a before_filter thrown on a facebook auth_token. Here is >> the code. =====================================================>> # when a user authenticates to facebook this before filter redirects >> # the user back to a fbml canvas page instead of to html on our >> server. >> before_filter :redirect_if_auth_key >> >> # keeps the user inside facebook >> def redirect_if_auth_key >> if( params[:auth_token]) >> redirect_to( url_for(:action => "whateveryouwant", >> :canvas => true, :only_path => false)) >> end >> end >> =====================================================>> >> Try the filter in your app/controller/application.rb. >> >> Richard >> >> >> On Thu, 14 Aug 2008, Allen Walker wrote: >> >> If someone isn''t logged in this filter works - it takes them >> to the facebook login page. However after logging in it''s >> going to my root application URL outside of facebook. How do I >> set the proper redirect URL after a user logs into facebook? >> >> thanks >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> <mailto:Facebooker-talk at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org <mailto:Facebooker-talk at rubyforge.org> >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080815/7d126083/attachment.html>
Mike Mangino
2008-Aug-15 16:45 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
That should work for the authorize url as well, somebody just needs to submit a patch (hint hint) Mike On Aug 15, 2008, at 11:58 AM, David Clements wrote:> Yes, You can overide the install url in your application.rb by > doing something like this: > > > def application_is_not_installed_by_facebook_user > redirect_to acebook_session.install_url(:next => next_path() ) > end > > Then define next path as a relative part of a canvas url. > > Dave > > > > > On Fri, Aug 15, 2008 at 9:54 AM, dara <dara at catch.fm> wrote: > True, you can set post add/authorise URL''s, but these are static. > > Is this what you want, or is there good a way to let a user continue > an action post add/authorise ? > > i.e. > > 1. click a link to do ''something'' > 2. add/authorise the application > 3. continue on with the action requested in 1 > > > David Clements wrote: > I think this is because you have your callback url as the post add > url. If you make the post add url a canvas page you won''t see this > behavior. > > Dave > > > On Fri, Aug 15, 2008 at 9:28 AM, Richard Jordan <jordanr at cs.washington.edu > <mailto:jordanr at cs.washington.edu>> wrote: > > I use a before_filter thrown on a facebook auth_token. Here is > the code. =====================================================> # when a user authenticates to facebook this before filter > redirects > # the user back to a fbml canvas page instead of to html on our > server. > before_filter :redirect_if_auth_key > > # keeps the user inside facebook > def redirect_if_auth_key > if( params[:auth_token]) > redirect_to( url_for(:action => "whateveryouwant", > :canvas => true, :only_path => false)) > end > end > =====================================================> > Try the filter in your app/controller/application.rb. > > Richard > > > On Thu, 14 Aug 2008, Allen Walker wrote: > > If someone isn''t logged in this filter works - it takes them > to the facebook login page. However after logging in it''s > going to my root application URL outside of facebook. How do I > set the proper redirect URL after a user logs into facebook? > > thanks > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > <mailto:Facebooker-talk at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org <mailto:Facebooker- > talk at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > ------------------------------------------------------------------------ > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Allen Walker
2008-Aug-16 04:38 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
I did the following and it''s still redirecting to my base web page url ( www.xxx.com) and not my facebook app: in application.rb I have: before_filter :redirect_if_auth_key *def redirect_if_auth_key if( params[:auth_token]) redirect_to( url_for(:controller =>"public", :action => "index", :canvas => true, :only_path => false)) end end* On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan <jordanr at cs.washington.edu>wrote:> I use a before_filter thrown on a facebook auth_token. Here is the code. > =====================================================> # when a user authenticates to facebook this before filter redirects > # the user back to a fbml canvas page instead of to html on our server. > before_filter :redirect_if_auth_key > > # keeps the user inside facebook > def redirect_if_auth_key > if( params[:auth_token]) > redirect_to( url_for(:action => "whateveryouwant", > :canvas => true, :only_path => false)) > end > end > =====================================================> > Try the filter in your app/controller/application.rb. > > Richard > > On Thu, 14 Aug 2008, Allen Walker wrote: > > If someone isn''t logged in this filter works - it takes them to the >> facebook login page. However after logging in it''s going to my root >> application URL outside of facebook. How do I set the proper redirect URL >> after a user logs into facebook? >> >> thanks >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >>-- http://auswalk.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080815/e1ff52a4/attachment.html>
Richard Jordan
2008-Aug-16 19:17 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
Gee, nothing ever works it seems. Is the filter ever hitting? Do you ever get params[:auth_token] to be true? Is the filter the problem or the redirection? I have an app up and working and available on GitHub with that code in it,> git clone git://github.com/jordanr/couple-rater.gitHere are some of my facebook settings,> Callback URL > http://www.xxx.com/ > Canvas URL > http://apps.facebook.com/couplerater/ > Post-Add URL > http://apps.facebook.com/couplerater > Post-Remove URL > http://www.xxx.com/uninstallBut really, I defer to Dave and Mike on anything. I''d first try to do it their way. Richard On Fri, 15 Aug 2008, Allen Walker wrote:> I did the following and it''s still redirecting to my base web page url ( > www.xxx.com) and not my facebook app: > > in application.rb I have: > > before_filter :redirect_if_auth_key > > *def redirect_if_auth_key > if( params[:auth_token]) > redirect_to( url_for(:controller =>"public", :action => "index", > :canvas => true, :only_path => false)) > end > end* > > > > On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan > <jordanr at cs.washington.edu>wrote: > >> I use a before_filter thrown on a facebook auth_token. Here is the code. >> =====================================================>> # when a user authenticates to facebook this before filter redirects >> # the user back to a fbml canvas page instead of to html on our server. >> before_filter :redirect_if_auth_key >> >> # keeps the user inside facebook >> def redirect_if_auth_key >> if( params[:auth_token]) >> redirect_to( url_for(:action => "whateveryouwant", >> :canvas => true, :only_path => false)) >> end >> end >> =====================================================>> >> Try the filter in your app/controller/application.rb. >> >> Richard >> >> On Thu, 14 Aug 2008, Allen Walker wrote: >> >> If someone isn''t logged in this filter works - it takes them to the >>> facebook login page. However after logging in it''s going to my root >>> application URL outside of facebook. How do I set the proper redirect URL >>> after a user logs into facebook? >>> >>> thanks >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >>> >>> > > >
Allen Walker
2008-Aug-16 21:58 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
It appears to be going to "www.facebook.com/myapp/relative_url" instead of "apps.new.facebook.com/myapp/relative_url" Richard Jordan wrote:> Gee, nothing ever works it seems. Is the filter ever hitting? Do you > ever get params[:auth_token] to be true? Is the filter the problem or > the redirection? > > I have an app up and working and available on GitHub with that code in > it, >> git clone git://github.com/jordanr/couple-rater.git > > Here are some of my facebook settings, >> Callback URL >> http://www.xxx.com/ >> Canvas URL >> http://apps.facebook.com/couplerater/ >> Post-Add URL >> http://apps.facebook.com/couplerater >> Post-Remove URL >> http://www.xxx.com/uninstall > > But really, I defer to Dave and Mike on anything. I''d first try to do > it their way. > > Richard > > On Fri, 15 Aug 2008, Allen Walker wrote: > >> I did the following and it''s still redirecting to my base web page url ( >> www.xxx.com) and not my facebook app: >> >> in application.rb I have: >> >> before_filter :redirect_if_auth_key >> >> *def redirect_if_auth_key >> if( params[:auth_token]) >> redirect_to( url_for(:controller =>"public", :action => "index", >> :canvas => true, :only_path => false)) >> end >> end* >> >> >> >> On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan >> <jordanr at cs.washington.edu>wrote: >> >>> I use a before_filter thrown on a facebook auth_token. Here is the >>> code. >>> =====================================================>>> # when a user authenticates to facebook this before filter redirects >>> # the user back to a fbml canvas page instead of to html on our >>> server. >>> before_filter :redirect_if_auth_key >>> >>> # keeps the user inside facebook >>> def redirect_if_auth_key >>> if( params[:auth_token]) >>> redirect_to( url_for(:action => "whateveryouwant", >>> :canvas => true, :only_path => false)) >>> end >>> end >>> =====================================================>>> >>> Try the filter in your app/controller/application.rb. >>> >>> Richard >>> >>> On Thu, 14 Aug 2008, Allen Walker wrote: >>> >>> If someone isn''t logged in this filter works - it takes them to the >>>> facebook login page. However after logging in it''s going to my root >>>> application URL outside of facebook. How do I set the proper >>>> redirect URL >>>> after a user logs into facebook? >>>> >>>> thanks >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> >>>> >> >> >> >
Richard Jordan
2008-Aug-16 22:26 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
So now you redirect to a facebook error page that says something like "this page does not exist"? You are no longer redirected back to your server? Richard On Sat, 16 Aug 2008, Allen Walker wrote:> It appears to be going to "www.facebook.com/myapp/relative_url" instead of > "apps.new.facebook.com/myapp/relative_url" > > Richard Jordan wrote: >> Gee, nothing ever works it seems. Is the filter ever hitting? Do you >> ever get params[:auth_token] to be true? Is the filter the problem or the >> redirection? >> >> I have an app up and working and available on GitHub with that code in it, >> > git clone git://github.com/jordanr/couple-rater.git >> >> Here are some of my facebook settings, >> > Callback URL >> > http://www.xxx.com/ >> > Canvas URL >> > http://apps.facebook.com/couplerater/ >> > Post-Add URL >> > http://apps.facebook.com/couplerater >> > Post-Remove URL >> > http://www.xxx.com/uninstall >> >> But really, I defer to Dave and Mike on anything. I''d first try to do it >> their way. >> >> Richard >> >> On Fri, 15 Aug 2008, Allen Walker wrote: >> >> > I did the following and it''s still redirecting to my base web page url ( >> > www.xxx.com) and not my facebook app: >> > >> > in application.rb I have: >> > >> > before_filter :redirect_if_auth_key >> > >> > *def redirect_if_auth_key >> > if( params[:auth_token]) >> > redirect_to( url_for(:controller =>"public", :action => "index", >> > : canvas => true, :only_path => false)) >> > end >> > end* >> > >> > >> > >> > On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan >> > <jordanr at cs.washington.edu>wrote: >> > >> > > I use a before_filter thrown on a facebook auth_token. Here is the >> > > code. >> > > =====================================================>> > > # when a user authenticates to facebook this before filter redirects >> > > # the user back to a fbml canvas page instead of to html on our >> > > server. >> > > before_filter :redirect_if_auth_key >> > > >> > > # keeps the user inside facebook >> > > def redirect_if_auth_key >> > > if( params[:auth_token]) >> > > redirect_to( url_for(:action => "whateveryouwant", >> > > : canvas => true, :only_path => false)) >> > > end >> > > end >> > > =====================================================>> > > >> > > Try the filter in your app/controller/application.rb. >> > > >> > > Richard >> > > >> > > On Thu, 14 Aug 2008, Allen Walker wrote: >> > > >> > > If someone isn''t logged in this filter works - it takes them to the >> > > > facebook login page. However after logging in it''s going to my root >> > > > application URL outside of facebook. How do I set the proper >> > > > redirect URL >> > > > after a user logs into facebook? >> > > > >> > > > thanks >>>>> _______________________________________________ >> > > > Facebooker-talk mailing list >> > > > Facebooker-talk at rubyforge.org >> > > > http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > > >> > > > >> > > > >> > >> > >> > >> > > >
Allen Walker
2008-Aug-16 22:31 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
When I try to access the app url and I''m not logged in, it redirects to "this page doesn''t exist" with the URL: http://www.facebook.com/myapp/activities/12 So I then login and then it goes to www.facebook.com home page. Richard Jordan wrote:> So now you redirect to a facebook error page that says something like > "this page does not exist"? You are no longer redirected back to your > server? > > Richard > > On Sat, 16 Aug 2008, Allen Walker wrote: > >> It appears to be going to "www.facebook.com/myapp/relative_url" >> instead of "apps.new.facebook.com/myapp/relative_url" >> >> Richard Jordan wrote: >>> Gee, nothing ever works it seems. Is the filter ever hitting? Do you >>> ever get params[:auth_token] to be true? Is the filter the problem >>> or the >>> redirection? >>> >>> I have an app up and working and available on GitHub with that code >>> in it, >>> > git clone git://github.com/jordanr/couple-rater.git >>> >>> Here are some of my facebook settings, >>> > Callback URL >>> > http://www.xxx.com/ >>> > Canvas URL >>> > http://apps.facebook.com/couplerater/ >>> > Post-Add URL >>> > http://apps.facebook.com/couplerater >>> > Post-Remove URL >>> > http://www.xxx.com/uninstall >>> >>> But really, I defer to Dave and Mike on anything. I''d first try to >>> do it >>> their way. >>> >>> Richard >>> >>> On Fri, 15 Aug 2008, Allen Walker wrote: >>> >>> > I did the following and it''s still redirecting to my base web >>> page url ( >>> > www.xxx.com) and not my facebook app: >>> > > in application.rb I have: >>> > > before_filter :redirect_if_auth_key >>> > > *def redirect_if_auth_key >>> > if( params[:auth_token]) >>> > redirect_to( url_for(:controller =>"public", :action => >>> "index", >>> > : canvas => true, :only_path => false)) >>> > end >>> > end* >>> > > > > On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan >>> > <jordanr at cs.washington.edu>wrote: >>> > > > I use a before_filter thrown on a facebook auth_token. Here >>> is the > > code. >>> > > =====================================================>>> > > # when a user authenticates to facebook this before filter >>> redirects >>> > > # the user back to a fbml canvas page instead of to html on our >>> > > server. >>> > > before_filter :redirect_if_auth_key >>> > > > > # keeps the user inside facebook >>> > > def redirect_if_auth_key >>> > > if( params[:auth_token]) >>> > > redirect_to( url_for(:action => "whateveryouwant", >>> > > : canvas => true, :only_path => false)) >>> > > end >>> > > end >>> > > =====================================================>>> > > > > Try the filter in your app/controller/application.rb. >>> > > > > Richard >>> > > > > On Thu, 14 Aug 2008, Allen Walker wrote: >>> > > > > If someone isn''t logged in this filter works - it takes >>> them to the >>> > > > facebook login page. However after logging in it''s going to >>> my root >>> > > > application URL outside of facebook. How do I set the proper >>> > > > redirect URL >>> > > > after a user logs into facebook? >>> > > > > > > thanks >>>>>> _______________________________________________ >>> > > > Facebooker-talk mailing list >>> > > > Facebooker-talk at rubyforge.org >>> > > > http://rubyforge.org/mailman/listinfo/facebooker-talk >>> > > > > > > > > > > > > >> >> >> >
Richard Jordan
2008-Aug-16 23:00 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
Weird, I''ve never seen that before. But, I think you''re real close -- some strange bug somewhere. Sorry, I really can''t image where. On Sat, 16 Aug 2008, Allen Walker wrote:> When I try to access the app url and I''m not logged in, it redirects to "this > page doesn''t exist" with the URL: http://www.facebook.com/myapp/activities/12 > > So I then login and then it goes to www.facebook.com home page. > > > > Richard Jordan wrote: >> So now you redirect to a facebook error page that says something like >> "this page does not exist"? You are no longer redirected back to your >> server? >> >> Richard >> >> On Sat, 16 Aug 2008, Allen Walker wrote: >> >> > It appears to be going to "www.facebook.com/myapp/relative_url" instead >> > of "apps.new.facebook.com/myapp/relative_url" >> > >> > Richard Jordan wrote: >> > > Gee, nothing ever works it seems. Is the filter ever hitting? Do >> > > you >> > > ever get params[:auth_token] to be true? Is the filter the problem >> > > or the >> > > redirection? >> > > >> > > I have an app up and working and available on GitHub with that code in >> > > it, >> > > > git clone git://github.com/jordanr/couple-rater.git >> > > >> > > Here are some of my facebook settings, >> > > > Callback URL >> > > > http://www.xxx.com/ >> > > > Canvas URL >> > > > http://apps.facebook.com/couplerater/ >> > > > Post-Add URL >> > > > http://apps.facebook.com/couplerater >> > > > Post-Remove URL >> > > > http://www.xxx.com/uninstall >> > > >> > > But really, I defer to Dave and Mike on anything. I''d first try to do >> > > it >> > > their way. >> > > >> > > Richard >> > > >> > > On Fri, 15 Aug 2008, Allen Walker wrote: >> > > >> > > > I did the following and it''s still redirecting to my base web >> > > page url ( >> > > > www.xxx.com) and not my facebook app: >> > > > > in application.rb I have: >> > > > > before_filter :redirect_if_auth_key >> > > > > *def redirect_if_auth_key >> > > > if( params[:auth_token]) >> > > > redirect_to( url_for(:controller =>"public", :action => >> > > "index", >> > > > : canvas => true, :only_path => false)) >> > > > end >> > > > end* >> > > > > > > On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan >> > > > <jordanr at cs.washington.edu>wrote: >> > > > > > I use a before_filter thrown on a facebook auth_token. Here >> > > is the > > code. >> > > > > =====================================================>> > > > > # when a user authenticates to facebook this before filter >> > > redirects >> > > > > # the user back to a fbml canvas page instead of to html on our >> > > > > server. >> > > > > before_filter :redirect_if_auth_key >> > > > > > > # keeps the user inside facebook >> > > > > def redirect_if_auth_key >> > > > > if( params[:auth_token]) >> > > > > redirect_to( url_for(:action => "whateveryouwant", >> > > > > : canvas => true, :only_path => false)) >> > > > > end >> > > > > end >> > > > > =====================================================>> > > > > > > Try the filter in your app/controller/application.rb. >> > > > > > > Richard >> > > > > > > On Thu, 14 Aug 2008, Allen Walker wrote: >> > > > > > > If someone isn''t logged in this filter works - it takes >> > > them to the >> > > > > > facebook login page. However after logging in it''s going to >> > > my root >> > > > > > application URL outside of facebook. How do I set the proper >> > > > > > redirect URL >> > > > > > after a user logs into facebook? >> > > > > > > > > thanks >>>>>>> _______________________________________________ >> > > > > > Facebooker-talk mailing list >> > > > > > Facebooker-talk at rubyforge.org >> > > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > > > > > > > > > > > > > >> > >> > >> > >> > >
David Clements
2008-Aug-17 00:00 UTC
[Facebooker-talk] ensure_authenticated_to_facebook - redirect?
Are you returning false in that before filter? By returning false you will halt the request execution. Dave On Sat, Aug 16, 2008 at 1:17 PM, Richard Jordan <jordanr at cs.washington.edu>wrote:> Gee, nothing ever works it seems. Is the filter ever hitting? Do you ever > get params[:auth_token] to be true? Is the filter the problem or the > redirection? > > I have an app up and working and available on GitHub with that code in it, > >> git clone git://github.com/jordanr/couple-rater.git >> > > Here are some of my facebook settings, > >> Callback URL >> http://www.xxx.com/ >> Canvas URL >> http://apps.facebook.com/couplerater/ >> Post-Add URL >> http://apps.facebook.com/couplerater >> Post-Remove URL >> http://www.xxx.com/uninstall >> > > But really, I defer to Dave and Mike on anything. I''d first try to do it > their way. > > Richard > > > On Fri, 15 Aug 2008, Allen Walker wrote: > > I did the following and it''s still redirecting to my base web page url ( >> www.xxx.com) and not my facebook app: >> >> in application.rb I have: >> >> before_filter :redirect_if_auth_key >> >> *def redirect_if_auth_key >> if( params[:auth_token]) >> redirect_to( url_for(:controller =>"public", :action => "index", >> :canvas => true, :only_path => false)) >> end >> end* >> >> >> >> On Fri, Aug 15, 2008 at 10:28 AM, Richard Jordan >> <jordanr at cs.washington.edu>wrote: >> >> I use a before_filter thrown on a facebook auth_token. Here is the code. >>> =====================================================>>> # when a user authenticates to facebook this before filter redirects >>> # the user back to a fbml canvas page instead of to html on our server. >>> before_filter :redirect_if_auth_key >>> >>> # keeps the user inside facebook >>> def redirect_if_auth_key >>> if( params[:auth_token]) >>> redirect_to( url_for(:action => "whateveryouwant", >>> :canvas => true, :only_path => false)) >>> end >>> end >>> =====================================================>>> >>> Try the filter in your app/controller/application.rb. >>> >>> Richard >>> >>> On Thu, 14 Aug 2008, Allen Walker wrote: >>> >>> If someone isn''t logged in this filter works - it takes them to the >>> >>>> facebook login page. However after logging in it''s going to my root >>>> application URL outside of facebook. How do I set the proper redirect >>>> URL >>>> after a user logs into facebook? >>>> >>>> thanks >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> >>>> >>>> >> >> >> _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080816/6be80f14/attachment.html>