15

According to https://developers.facebook.com/blog/post/552/ the FB Graph API now appends a _=_ hash to the end of the URL it redirects back to when redirect_uri is not set. However, it is still appending it even though my call specifies the redirect_uri.

Short of redirecting again after FB returns to my site, how can I get FB to stop appending the hash?

PS - the hash is breaking backbone.js and I need it gone. This isn't just a pet peeve.

Brenden
  • 7,708
  • 11
  • 61
  • 75
  • what have you specified the redirect_uri as? – bool.dev Oct 08 '11 at 03:32
  • check here : http://facebook.stackoverflow.com/questions/7338853/php-location-header-ignore-hash/7340855#7340855 and here : http://stackoverflow.com/q/7131909/720508 , i think the only way to resolve this now is through javascript – bool.dev Oct 08 '11 at 03:42
  • Thanks, I answered my Q so others can see how I dealt with the issue for now. – Brenden Oct 08 '11 at 07:43

1 Answers1

7

http://developers.facebook.com/bugs/196125357123225

Apparently the Facebook Graph API documentation is incorrect and a bug has been submitted. Sad face.

My hack fix was to override the redirect on the server side and replace the hash with my own so that the FB hash was not included in the redirect(in ruby).

Brenden
  • 7,708
  • 11
  • 61
  • 75
  • Just noticed this myself. My test page is just entering an infinite redirect loop. Has Facebook said anything past their "We're triaging this" comments? – Ian Oct 13 '11 at 13:10
  • Brenden> can you post the code snippet you used to override the redirect? – GeorgeW Nov 02 '11 at 01:55
  • 4
    Why is my answer down voted to -2? @GeorgeW, I don't ahve the code currently, but it wasn't too hard. Just detect the hash and redirect with your own hashed URL – Brenden Dec 21 '11 at 03:38
  • @Brenden stumbled upon this post again and saw your comment. I just want to make it clear that I never down vote your answer. In general, a code snippet is more than a thousand words. For example: http://stackoverflow.com/questions/8362681/added-to-url-by-facebook – GeorgeW Oct 25 '12 at 02:11
  • @GeorgeW I never thought you did :) Point taken re:code snippets. PS - let's continue this convo in a year :D – Brenden Oct 09 '13 at 21:39
  • It does the same thing for google omniauth, so I get an error no route matches, it appends # (hashtag) after request uri https://.....herokuapp.com/auth/google_oauth2/callback?state=19feaacfe23423jh5jhhGSDFwb419049ebb18dabdf8&code=4/glrY3-mSlTzwerwERTEG334eXcn3hOSxGuc51BAlglPa4AU# – Shalafister's Aug 17 '16 at 08:54