hello the non rails url is https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/oauth_redirect how do i use redirect_to method in my rails app to redirect to the url above? i am confused how to append params.All of the following three ways don''t work. 1 redirect_to("https://graph.facebook.com/oauth/authorize?",:overwrite_params=>{''client_id''=>''1038eeaa39323304f3319aac31f472d2'',''redirect_uri''=>''http://custom-survey.heroku.com/users/normal_auth_result''}) 2 redirect_to("https://graph.facebook.com/oauth/authorize?","client_id=1038eeaa39323304f3319aac31f472d2&redirect_ur=http://custom-survey.heroku.com/users/normal_auth_result") 3 redirect_to("https://graph.facebook.com/oauth/authorize?client_id=1038eeaa39323304f3319aac31f472d2&redirect_ur=http://custom-survey.heroku.com/users/normal_auth_result") -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 16 December 2010 16:35, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hello > the non rails url is > > https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/oauth_redirect > > how do i use redirect_to method in my rails app to redirect to the url > above? i am confused how to append params.All of the following three > ways don''t work.Just pass the complete url in as a string. Colin> 1 > redirect_to("https://graph.facebook.com/oauth/authorize?",:overwrite_params=>{''client_id''=>''1038eeaa39323304f3319aac31f472d2'',''redirect_uri''=>''http://custom-survey.heroku.com/users/normal_auth_result''}) > 2 > redirect_to("https://graph.facebook.com/oauth/authorize?","client_id=1038eeaa39323304f3319aac31f472d2&redirect_ur=http://custom-survey.heroku.com/users/normal_auth_result") > 3 > redirect_to("https://graph.facebook.com/oauth/authorize?client_id=1038eeaa39323304f3319aac31f472d2&redirect_ur=http://custom-survey.heroku.com/users/normal_auth_result") > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #968890:> On 16 December 2010 16:35, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> hello >> the non rails url is >> >> >https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/oauth_redirect>> >> how do i use redirect_to method in my rails app to redirect to the url >> above? i am confused how to append params.All of the following three >> ways don''t work. > > Just pass the complete url in as a string. > > ColinBut using the complete url, this url--https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/oauth_redirect-- is not triggered directly by browser,which just displays an link.when i click that link, the above url is triggered, which is not the expected behavior.Maybe it is becuse the new facebook authen. colin,is there any other way to redirect_to non rails url containing params? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 17 December 2010 10:47, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #968890: >> On 16 December 2010 16:35, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> hello >>> the non rails url is >>> >>> >> > https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/oauth_redirect >>> >>> how do i use redirect_to method in my rails app to redirect to the url >>> above? i am confused how to append params.All of the following three >>> ways don''t work. >> >> Just pass the complete url in as a string. >> >> Colin > > But using the complete url, this > url--https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/oauth_redirect-- > is not triggered directly by browser,which just displays an link.when i > click that link, the above url is triggered, which is not the expected > behavior.Maybe it is becuse the new facebook authen.Sorry I have not the foggiest idea what you are talking about. Are you saying redirect_to is not generating the html you expect? Perhaps you should show exactly the code you have used, and the html generated, and explain what is wrong with it. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #969042:> On 17 December 2010 10:47, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>>> above? i am confused how to append params.All of the following three >> behavior.Maybe it is becuse the new facebook authen. > Sorry I have not the foggiest idea what you are talking about. Are > you saying redirect_to is not generating the html you expect? > Perhaps you should show exactly the code you have used, and the html > generated, and explain what is wrong with it. > > Colincolin I am developing an app for facebook.Facebook need to authorize the user using the fllowing authorize url whose response should be a popup iframe. #sorry,i can not post my client_id.this url with params is offered by facebook,and i should replace the client_id and redirect_uri with myown. authorize_url="https://graph.facebook.com/oauth/authorize?client_id=...&redirect_ur=http://custom-survey.heroku.com/users/normal_auth_result" #when user is not authorized,redirect to authorize_url to authorize user #in my rails app. redirect_to(authorize_url) so when redirect_to(authorize_url) runs,a popup(2.png) should appear,but i get an image with bottom link(1.png). what''s more,when i click the 1.png,the 2.png appears.I mean i should get the 2.png directly,not the indirect one like above.I am sure i am doing to the fb doc,and the authorize_url is made as fb doc says. I think maybe it is because i am using the new beta authorizing mechanism which is still in development.or maybe rails method redirect_to has special grammar when it comes to non rails url with params. Attachments: http://www.ruby-forum.com/attachment/5581/1.jpg http://www.ruby-forum.com/attachment/5582/2.jpg -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 17 December 2010 13:26, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> [...] > I am developing an app for facebook.Facebook need to authorize the user > using the fllowing authorize url whose response should be a popup > iframe. > > #sorry,i can not post my client_id.this url with params is offered by > facebook,and i should replace the client_id and redirect_uri with myown. > > authorize_url="https://graph.facebook.com/oauth/authorize?client_id=...&redirect_ur=http://custom-survey.heroku.com/users/normal_auth_result" > > #when user is not authorized,redirect to authorize_url to authorize user > #in my rails app. > > redirect_to(authorize_url) > > so when redirect_to(authorize_url) runs,a popup(2.png) should appear,but > i get an image with bottom link(1.png). what''s more,when i click the > 1.png,the 2.png appears.I mean i should get the 2.png directly,not the > indirect one like above.I am sure i am doing to the fb doc,and the > authorize_url is made as fb doc says. > I think maybe it is because i am using the new beta authorizing > mechanism which is still in development.or maybe rails method > redirect_to has special grammar when it comes to non rails url with > params.What happens if you put the url directly into the browser window? What does the rails log show when it runs the redirect? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #969060:> On 17 December 2010 13:26, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> #when user is not authorized,redirect to authorize_url to authorize user >> mechanism which is still in development.or maybe rails method >> redirect_to has special grammar when it comes to non rails url with >> params. > > What happens if you put the url directly into the browser window? > when put it in browser directly,the response works well like fb docsays,popuping an iframe.> What does the rails log show when it runs the redirect? > i have attached the server log images.As it shows,when ''signed_request'' paramimplys the user is not authorized in the home/index method,he will be redirected to fb url(whose response should be popup window) "https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://custom-survey.heroku.com/users/normal_auth_result".But i still need to click 1.png to get popup window.> ColinAttachments: http://www.ruby-forum.com/attachment/5588/3.jpg -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 17 December 2010 15:03, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #969060: >> On 17 December 2010 13:26, Guo Yangguang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> #when user is not authorized,redirect to authorize_url to authorize user >>> mechanism which is still in development.or maybe rails method >>> redirect_to has special grammar when it comes to non rails url with >>> params. >> >> What happens if you put the url directly into the browser window? >> when put it in browser directly,the response works well like fb doc > says,popuping an iframe. > >> What does the rails log show when it runs the redirect? >> i have attached the server log images.As it shows,when ''signed_request'' param > implys the user is not authorized in the home/index method,he will be redirected > to fb url(whose response should be popup window) > "https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://custom-survey.heroku.com/users/normal_auth_result".But > i still need to click 1.png to get popup window.So you are saying that if you enter the url directly in the browser you get one result, but if you use rails to redirect to exactly the same url then you get a different effect? What happens if you just put a link to that url on your web page and click it? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Guo Yangguang
2010-Dec-17 15:56 UTC
Re: Re: Re: Re: redirect_to an non rails url with params
> So you are saying that if you enter the url directly in the browser > you get one result, but if you use rails to redirect to exactly the > same url then you get a different effect?yes,that is right.> What happens if you just put a link to that url on your web page and > click it?i appreciate this debug way.i have made a link and click it on my page,the result is right,a popup window appears. i think i don''t need to attach an image to show it.Colin,it seems redirect_to method doesn''t work well with facebook url. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Dec-17 15:59 UTC
Re: Re: Re: Re: redirect_to an non rails url with params
Guo Yangguang wrote in post #969080:>> So you are saying that if you enter the url directly in the browser >> you get one result, but if you use rails to redirect to exactly the >> same url then you get a different effect? > yes,that is right.Perhaps there is an authentication issue, either involving a cookie or HTTP-Basic authentication. In that case, you need to get the authentication happening.>> What happens if you just put a link to that url on your web page and >> click it? > i appreciate this debug way.i have made a link and click it on my > page,the result is right,a popup window appears. i think i don''t need to > attach an image to show it.Colin,it seems redirect_to method doesn''t > work well with facebook url.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Guo Yangguang
2010-Dec-18 02:49 UTC
Re: Re: Re: Re: redirect_to an non rails url with params
Marnen Laibow-Koser wrote in post #969084: Perhaps there is an authentication issue, either involving a cookie or HTTP-Basic authentication. In that case, you need to get the authentication happening. but how? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.