Creating a new facebook application, no signed request is being sent through. Old app works - facebook

I have just created a new facebook application to use in a page tab. When I check for the signed_request it is empty.
So I checked another app that I have done in the past. It is on the same server and the only difference in the setup is the dir name.
http://example.com/app1/ works
and
http://example.com/app2/ doesn't
So I tried swapping the tab URLs in the apps over and app1 still works with app2s URL.
This lead me to believe there must be a problem with the way I have set up the application.
So I went through all the settings and made sure they were the same. They all are, except there are 2 that are not available on the app I just setup. They are "Encrypted Access Token" and "Requests 2.0 efficient" neither of which seem to relate to the problem.
I seem to remember in the past there was an option to pass through the signed request to canvas page, but I can no longer find it.
Has signed request been deprecated? I couldn't see any mention of that in the docs.
Any help/comment appreciated. Otherwise I am going to have to go back and re-use old apps with new content in them, and I only have about 15 more before I run out.
Cheers
Alex

No, it wasn't deprecated.
There can be 2 issues that could cause this
You must have a trailing slash or a specific file on your page tab url.
http://myapp.com/app/
http://myapp.com/app/index.php
Your server for the second app is redirecting the request which causes it to lose the POST variables.
You should check if there aren't any redirects which usually occur form mod_rewrite. (.htaccess and such)

This seems to have been resolved now, I can no longer replicate it with new applications.

Related

URI mismatch in facebook oauth login

I've read quite a few question on stack overflow about that. this one and this one and quite a few others...
I've tried with and without encoding the redirect URI in the address bar . With and without https. With and without the final slash. And every combination of the above. I've triple checked the client ID.
encode/decode:
http%3A%2F%2Flocalhost%3A9000%2F
http://localhost:9000/
https://www.facebook.com/dialog/oauth?client_id=272730539567323&redirect_uri=http%3A%2F%2Flocalhost%3A9000%2F
At some point, my code worked, And I logged in with it! Then I tried to change the redirection urls, and it never worked again, even after going back.
The worst is that I'm already logged in and you can see my name and profile picture on the screen !!!
I'm running out of ideas...
Note: I'm not including the actual code as I think it is irrelevant to the question and scala/play specific would only reduce the number of people trying to answer.
Solution:
I'm not sure why, I had been able to login before because I do not remember having ever set/unset the above settings in "settings->advanced tab-> Client OAuth settings".
But if you encounter this problem, here lies the answser.

Redirects in Ektron 8.6.1

Has anyone played with the new redirect feature in Ektron 8.6?
We tested it (in 8.6.0) before upgrading and were happy with it. But when it came time to do the upgrade, Ektron had released 8.6.1, so we upgraded directly to that.
Now we are having trouble with the redirect feature. (Yes, we should have tested everything again in 8.6.1 before upgrading)
Now if we try to add a redirect rule for an existing page in the CMS, it does not work.
But if we create a redirect rule for a page the does not exist, then try to hit that address, the redirect works fine.
We need the redirects to work for existing pages in the CMS.
To clarify what "working" and "not working" means...
If I have an existing page in the CMS with manual alias of "/erc/lucien.apsx", I can create an entry in the redirect table like this...
Adding this entry generates no errors, but when I visit the page, all I see is the regular old page I created. NOT the Google site it should be redirecting to. I do not get any 404 errors.
But if I create a redirect entry for a page that does not already exist, like this...
It works perfectly. If I try to visit the /erc/fake.apsx address, I end up on the Google site, as expected.
(FYI, we create a "fake" page in the CMS for external content so we can attach metadata to it and make it searchable in taxonomies, but then provide a link to the "real" page. I want to use redirects here so users don't have to do this extra click)
I suspect it might be cache related -- the original URL gets cached as an alias, then subsequent requests to that URL are redirected to the quicklink without the need for a db look up. When you add the redirect, it’s probably not clearing the old item from the cache. I'd try an IIS reset after you add the URL redirect and see if that clears up the issue.
An "outside the box" (of Ektron) answer to this is to place the redirect at the web server rather than in the Aliases section of the Ektron CMS.
The server I work on uses IIS and I have this set up for several pages.

Facebook: Updating page tabs through Javascript SDK

I'm trying to update my tab on a series of pages on facebook. Due to the volume of pages I'm making batch calls to keep from being rate limited. The batch calls work fine.
That being said, I'm trying to Update a page tab by making the call as stated here. I have the adding functionality working fine, and it's operating as it should. I use the same method of getting and using tokens, and I know moreso that it's not an issue as I have offline access so they don't expire (I get them every page load, but in reality could just store them and not worry about it).
Both calls use the same page ID, app ID, and access token and the call is good. The Error I receive is that the tab does not exist on the page, yet when I go to https://graph.facebook.com/PAGE_ID/tabs/APP_ID my tab is there showing itself as on the page. When I post to that I get the error it's not there.
My question is this: Has anyone gotten this working yet and if so what did your call look like and am I missing something?
I would post code, but it's incredibly long and intertwined in my program so it would be difficult to extract it.
There's a slight issue with the page tabs API at the moment that means in some situations you need to prepend your app id in the call with app_ so /PAGE_ID/tabs/app_APP_ID, give this a try and see if it works.

Facebook iframe tab signed request always empty

I'm working on a Facebook app tab and would like to use the signed request bundle as documented here:
http://developers.facebook.com/blog/post/462/
I'm trying to use their example code to unpackage the signed request which is supposedly passed to the tab, however, $_POST, $_GET, and $_REQUEST are always all empty.
The exact code works on the canvas page and I am able to parse the signed request.
Is there something that I'm missing in their recent announcement?
By the way, the app is not published to the marketplace, and the fanpage my tab is installed on is private. Will that make a difference?
-Seth
Okay, figured it out!
When configuring the app, I had filled in the "Tab URL" to be "tab/"
This made the full url to the tab page "http://www.example.com/myfacebookapp/tab/"
This made sense to me.
Apparently, Facebook doesn't like this. After changing my "Tab URL" to 'tab/index.php", the signed request started to show up in the app tab!
Essentially, the problem is that your webserver is performing a redirect when it receives the request. In your case, it's redirecting from http://www.example.com/myfacebookapp/tab/ to http://www.example.com/myfacebookapp/tab/index.php; in my case it was redirecting from http://www.example.com/myfacebookapp/tab to http://www.example.com/myfacebookapp/tab/ (my app is built in .Net MVC, so has no filenames, but needs that trailing slash, apparently).
So the canonical solution is to make sure that the path in the Tab URL field is the actual URL, not one that the webserver will redirect to. If the webserver has to make a redirect, then the real page is fetched by GET (not POST) and no signed_request postdata is provided to your script.
Very frustrating; I just spend an hour and a half debugging why my test app worked and the production one didn't. To make things worse, I knew this answer, it just didn't register that this was what the problem was. Very irritating!
Thanks Seth I was having the same problem. I could get a signed request on the app canvas page but not of my page tab. For clarification
go to www.facebook.com/developers/
click on edit settings for your app
click the Facebook Integration tab
at the bottom in the Page Tabs section in the Tab URL field enter in the path to the index.php page for your facebook landing page
ex. if your page is located at www.foobar.com/facebook/tab/index.php you need to put "tab/index.php" (without the quotes) rather than just "tab/"
Been trying to figure this out for days!
I found a solution:
Just put a "/" at the end of the tab url.
Like: "http://domain.us/facebook/tab/"
It worked for me, let us know if it also works for you!
Once you are Authenticate with Application you will get the signed_request data,
Authenticated as like in the below URLs
https://developers.facebook.com/docs/authentication/
https://developers.facebook.com/docs/reference/javascript/FB.login/

redirect on facebook app install

Upon install of my app on a Facebook Page, I'd like to send the user to an URL with further instructions. I'm starting the installation with http://facebook.com/add.php?api_key=app_api_key&page=page_id, which installs but redirects the user to the Facebook Page itself. It seems like various forms of redirect were available at some point:
Post-authorize callback URL. I can no longer find that in App settings.
The next parameter for add.php. I can't seem to get this to work
I have seen some apps that do redirect upon install, so I believe this is possible. Maybe it's using an old Post-authorize setting that's no longer visible?
Any help or point would be greatly appreciated! I'm also not attached to using add.php, if there's a Facebook Connect method that does this I'd use that instead (I'm looking at profile.addtab though that doesn't seem to work either).
You can set the redirect URL in the app properties. You can no longer set it from the developer control panel in Facebook, but you can still set it using the REST api.
The list of app properties is here: http://developers.facebook.com/docs/appproperties/
To set the "post_authorize_redirect_url" you would use something like this:
https://api.facebook.com/method/admin.setAppProperties?
access_token=CURRENTTOKEN&
properties={'post_authorize_redirect_url':'http://mydomain.com/post_authorize_folder/'}
I am not completely clear on this, but I believe the url needs to point to a folder, terminated with "/" rather than a specific file.
The callback gets two parameters:
installed = 1 (true)
fb_page_id = the page id when your app was installed
First page that Canvas is point to should have
< script type='text/javascript'>top.location.href = 'REDIRECT-URL';< /script>
So when your app is opened it will automaticaly redirect to REDIRECT-URL
I'm not sure that you can avoid opening of application canvas page after installing application.