API Error Code: 100

Apr 22, 2010 at 7:27 AM

I'm working on my second simple Facebook FBML application and have followed the instructions to make a basic "Hello, World" application but I keep getting the following error when running RequireLogin = true in the Page_PreInit:

Error

<form action="http://www.facebook.com/connect/uiserver.php" accept-charset="UNKNOWN" enctype="application/x-www-form-urlencoded" method="post">

An error occurred with [Application Name]. Please try again later.

</form>

API Error Code: 100
API Error Description: Invalid parameter
Error Message: Requires valid next URL.

This is a simple error I am over looking?  The URL in the browser at the time of the error is:

http://www.facebook.com/connect/uiserver.php?app_id=115781615108905&display=page&locale=en_US&return_session=0&fbconnect=0&canvas=1&legacy_return=1&method=permissions.request

Thanks for any help.

T. Rail

Apr 22, 2010 at 11:49 AM

Same problem here. Are there any changes in the facebook api?

Apr 22, 2010 at 4:22 PM

It seems this is related to the brand new consolidated permission dialog of facebook...

 

Apr 22, 2010 at 6:04 PM

ditto the same issue via MVC : helloworld example .. I think FB have change API

[FacebookAuthorization(IsFbml = false, ApiKey = APIKEY, Secret = SECRET)]
        public ActionResult Index(string app)
        {

            Api api = this.GetApi(APIKEY, SECRET);
            var user = api.Users.GetLoggedInUser();
            return Content("Hello, " + user.ToString());

           // return View();
        }

 
Apr 22, 2010 at 7:11 PM
Edited Apr 22, 2010 at 7:58 PM

If anybody is interested in a new version of the sdk: I integrated all necessary changes that everything works fine with the new api.

Apr 22, 2010 at 8:44 PM

which flavour of FDT are others using, don't understand why other app have not stopped working?

Apr 22, 2010 at 10:09 PM

Awexc is correct in that the new permissions dialog seems to required additional parameters. 

You can turn off the new dialog in your application settings in Facebook (Developer App -> Your App -> Settings -> Migrations -> "New Data Permissions" -> Disabled

It seems that this new property is automatically set to enabled when you create a new app (it was for the app I created a couple of hours ago) - for existing apps it's set to Disabled

Apr 23, 2010 at 7:32 AM

Great that worked, Deadline back on. :-) Thanks Ian

 Guess we may hit the issue again in June FB "(Migration ends on: June 1, 2010)"

Apr 23, 2010 at 1:06 PM

Hey that worked. Thank you so much for that.

But what exactly could be the reason? I mean how is "new Data Permissions" related to this problem??

Apr 23, 2010 at 3:07 PM
I have created a ticket for this, please vote as this workaround will stop working come June 1, 2010. http://facebooktoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=17383
Developer
Apr 25, 2010 at 9:49 PM

I just rewrote the auth part of this and am making sure it will be backwards compatible for existing apps and also need to test in webforms before i put up a fix.  The new permissions is awesome and makes it a much better user experience for new users to your app.

Developer
Apr 28, 2010 at 5:06 AM

I just updated the source to support the new data permissions and have tested it in two of our apps that are written in MVC.  I have tested it briefly in a webforms sample project, but any extra testing is appreciated. :)

 

Apr 28, 2010 at 8:12 AM
Edited Apr 28, 2010 at 8:15 AM
I have an experimental application at http://apps.facebook.com/podhawk. It is not in sandbox mode, so anyone can access it. I have changed "New data pemissions" to enabled to simulate how things will be after 1 June when the workround above runs out. The authorisation dialogue still returns the above error message, so it appears that the issue has not in fact been resolved. It would be helpful to know whether this is a bug; or whether developers need to change the code for their authorisation page. My code simply involves clicking on a link to the url returned by $facebook->get_add_url().
Apr 28, 2010 at 8:43 AM

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

Developer
Apr 28, 2010 at 1:15 PM
petercarter wrote:
I have an experimental application at http://apps.facebook.com/podhawk. It is not in sandbox mode, so anyone can access it. I have changed "New data pemissions" to enabled to simulate how things will be after 1 June when the workround above runs out. The authorisation dialogue still returns the above error message, so it appears that the issue has not in fact been resolved. It would be helpful to know whether this is a bug; or whether developers need to change the code for their authorisation page. My code simply involves clicking on a link to the url returned by $facebook->get_add_url().

I am a little confused, are you using .net?  $facebook->get_add_url() is a php function.

Developer
Apr 28, 2010 at 1:17 PM
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

I modeled it off of what i saw in the php library where it gets the next url from the current request.  Is this an iframe or fbml app?  I have done extensive testing on iframe, but not fbml yet.  I will look more deeply at fbml apps today also.

Apr 28, 2010 at 1:57 PM
Yes, of course $facebook->get_add_url() is a php statement. The Facebook php5 client is used to create a $facebook object. The get_add_url() method is supposed to return the url for an "authorise this application" link. Until the recent API changes, it did this. Now it appears not to do so. I have now rewritten this bit of my app so that creates a link to "https://graph.facebook.com/oauth/authorize?client_id=...&redirect_uri=http://www.example.com/callback&type=user-agent&display=popup" instead of to the url returned by $facebook->get_add_url(), and it works. But it would be nice if the php5 API client could work also.
Apr 28, 2010 at 2:30 PM
Some further information. facebook::get_add_url() takes an optional "next" argument, being the url of the page to which the user is sent after authorising the application. Previously, the "$next" argument could be omitted. A link was generated without a "&next=..." bit in the url. After the user authorised the application, he/she was simply sent to the canvas page, which was often the desired behaviour. Now, if the "$next" parameter is omitted, the error "requires valid next url" is generated when the user clicks the "authorise this application" link. The solution is to specify a "$next" argument in get_add_url, ie to obtain the url using $facebook->get_add_url("http://apps.facebook.com/canvas_page_name/"); The trailing slash appears to be important - Facebook doesn't think your app owns its own canvas page if you omit it. I hope this helps. The better long-term solution is presumably for Facebook to modify the php5 client so that get_add_url() returns a link to "https://graph.facebook.com..." as in my previous posting.
Apr 28, 2010 at 2:40 PM
jimzim wrote:
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

I modeled it off of what i saw in the php library where it gets the next url from the current request.  Is this an iframe or fbml app?  I have done extensive testing on iframe, but not fbml yet.  I will look more deeply at fbml apps today also.

It's an iframe application.

Developer
Apr 28, 2010 at 2:52 PM
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

So ours redirects to canvas url also in the iframe also which is our desired behavior.  Is it breaking out of facebook on yours?  After looking at the php library it looks ike the default the nexturl to the request url.  I will see if i can reproduce if it is breaking out of facebook if that is the case in your app.  Are you using mvc or webforms?  Do you have an app url you can expose or is it being developed?

 

Developer
Apr 28, 2010 at 6:38 PM
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

I think i found what you are talking about.  i see that our code in our web app was handling the redirect to app, i will get it to work right in the framework.

 

Developer
Apr 28, 2010 at 8:22 PM
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

Ok, try it now.  I just updated source to have it redirect to apps.facebook.com/appsuffix/ whatever your query was prior.  49954

You must have the Suffix set in your webconfig file so it knows where to go.  Facebook is requiring an absolute url and will not work with a relative url like it used to.

 

Apr 29, 2010 at 6:15 AM
Edited Apr 29, 2010 at 6:17 AM
It does not work again even when I switch back to old permission setting. If am using iFrame app
and I have set:
<add key="Callback" value="http://localhost:123/"/> <add key="Suffix" value="myappsuffix"/>
in web config and it is still not opened in iFrame.
Where should I set absolute URL? Can you please give an example.

Please consider:
My apps are worked before without Callback and Suffix keys in web config. As this values can
be read from facebook API if you have set APIKey and Secret keys , I believe that this is a really
drawback since I have to set the same things on 2 places (in Developer app and in web.config)
and change it again when I want to switch from localhost to server and vice versa. I believe that
it can be really obstacle and time wasting for all of us especially for new developers.
Apr 29, 2010 at 7:36 AM
jimzim wrote:
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

Ok, try it now.  I just updated source to have it redirect to apps.facebook.com/appsuffix/ whatever your query was prior.  49954

You must have the Suffix set in your webconfig file so it knows where to go.  Facebook is requiring an absolute url and will not work with a relative url like it used to.

 

Suffix is set, but after the login i'm still not getting redirected to the apps url (if i copy the value of the querystring "next" it works). Maybe it's ignoring the querystring "next"?

p.s.: i'm using webforms

 

Apr 29, 2010 at 9:14 AM

Is the fix relevant for Desktop applications as well?

Developer
Apr 29, 2010 at 3:25 PM
yannickhammens wrote:
jimzim wrote:
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

Ok, try it now.  I just updated source to have it redirect to apps.facebook.com/appsuffix/ whatever your query was prior.  49954

You must have the Suffix set in your webconfig file so it knows where to go.  Facebook is requiring an absolute url and will not work with a relative url like it used to.

 

Suffix is set, but after the login i'm still not getting redirected to the apps url (if i copy the value of the querystring "next" it works). Maybe it's ignoring the querystring "next"?

p.s.: i'm using webforms

 

try removing the app and reauthorize it.  I just hard coded a new url in the code to test and it did respect the new url, but only after i removed the app and reauthorized it.

Developer
Apr 29, 2010 at 3:28 PM
vatra wrote:
It does not work again even when I switch back to old permission setting. If am using iFrame app
and I have set:
<add key="Callback" value="http://localhost:123/"/> <add key="Suffix" value="myappsuffix"/>
in web config and it is still not opened in iFrame.
Where should I set absolute URL? Can you please give an example.

Please consider:
My apps are worked before without Callback and Suffix keys in web config. As this values can
be read from facebook API if you have set APIKey and Secret keys , I believe that this is a really
drawback since I have to set the same things on 2 places (in Developer app and in web.config)
and change it again when I want to switch from localhost to server and vice versa. I believe that
it can be really obstacle and time wasting for all of us especially for new developers.

So the only reason i had to add the suffix keys is because facebook does not pass them in the query string like they do the api key, etc.  Also another logged in user cannot call the getAppProperties api without being an admin so i cannot get the suffix through the api for other users.  Also this would cause another rest call which is less perfomant.  All this does not matter though if i can't get it from a public call.  It may be there in public somewhere, but i have been unable to find it yet.

 

Developer
Apr 29, 2010 at 3:33 PM
gilra wrote:

Is the fix relevant for Desktop applications as well?

I have not tested desktop apps, but am testing silverlight today, but i think that is using fb connect in javascript anyways.

 

Apr 29, 2010 at 4:04 PM

Unfortunately removing of apps and reauthorizing them is not an options since apps have

already users and they will not work. Do you suggest to wait for better solution and leave old

permission dialog until then?

 

Developer
Apr 29, 2010 at 4:13 PM
vatra wrote:

Unfortunately removing of apps and reauthorizing them is not an options since apps have

already users and they will not work. Do you suggest to wait for better solution and leave old

permission dialog until then?

 

I meant for you to personally test with your account to test to make sure it will redirect correctly.  Facebook may have cached the redirect based on your last allow. As far as other users that already use the app, you should be fine.  Since they have already authorized it, they will not get prompted with new permssions page unless you add some permissions that they have not allowed yet.  There could be bugs on this in facebook forums, but i have not looked that deep yet when moving existing app users.  Since the existing users are authorized, you should be fine.

Apr 30, 2010 at 7:41 AM
jimzim wrote:
yannickhammens wrote:
jimzim wrote:
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

Ok, try it now.  I just updated source to have it redirect to apps.facebook.com/appsuffix/ whatever your query was prior.  49954

You must have the Suffix set in your webconfig file so it knows where to go.  Facebook is requiring an absolute url and will not work with a relative url like it used to.

 

Suffix is set, but after the login i'm still not getting redirected to the apps url (if i copy the value of the querystring "next" it works). Maybe it's ignoring the querystring "next"?

p.s.: i'm using webforms

 

try removing the app and reauthorize it.  I just hard coded a new url in the code to test and it did respect the new url, but only after i removed the app and reauthorized it.

I tried that but still not getting redirected to apps

This is the url in the permissions window (http://www.facebook.com/connect/uiserver.php?app_id=107225865983079&next=http://apps.facebook.com/luckybd/default.aspx&display=page&cancel=http://apps.facebook.com/luckybd/default.aspx&locale=nl_NL&perms=email,offline_access,publish_stream&return_session=1&session_version=3&fbconnect=0&canvas=0&legacy_return=1&method=permissions.request

When i click allow i get redirected to

http://www.luckybastards.be/Default.aspx and not to http://apps.facebook.com/luckybd/default.aspx


 

Apr 30, 2010 at 7:02 PM
yannickhammens wrote:
jimzim wrote:
yannickhammens wrote:
jimzim wrote:
yannickhammens wrote:

The new data permissions works perfectly but i get redirect to the canvas url instead of the apps url (apps.facebook.com/....)

Ok, try it now.  I just updated source to have it redirect to apps.facebook.com/appsuffix/ whatever your query was prior.  49954

You must have the Suffix set in your webconfig file so it knows where to go.  Facebook is requiring an absolute url and will not work with a relative url like it used to.

 

Suffix is set, but after the login i'm still not getting redirected to the apps url (if i copy the value of the querystring "next" it works). Maybe it's ignoring the querystring "next"?

p.s.: i'm using webforms

 

try removing the app and reauthorize it.  I just hard coded a new url in the code to test and it did respect the new url, but only after i removed the app and reauthorized it.

I tried that but still not getting redirected to apps

This is the url in the permissions window (http://www.facebook.com/connect/uiserver.php?app_id=107225865983079&next=http://apps.facebook.com/luckybd/default.aspx&display=page&cancel=http://apps.facebook.com/luckybd/default.aspx&locale=nl_NL&perms=email,offline_access,publish_stream&return_session=1&session_version=3&fbconnect=0&canvas=0&legacy_return=1&method=permissions.request

When i click allow i get redirected to

http://www.luckybastards.be/Default.aspx and not to http://apps.facebook.com/luckybd/default.aspx


 

I am having the exact same problem. I downloaded the latest version of the source (FacebookToolkit-49954) and then enabled "New Data Permissions". I setup my dev server with the newly built DLLs and then tried to test my app. The permissions dialogue loaded correctly but after authorizing I got sent to a bizarre url.

http://<my website address>/?session={%22session_key%22%3A%222.tWgd0DoIWXHAHmdjqsNesw__.3600.1272657600-827400426%22%2C%22uid%22%3A%22827400426%22%2C%22expires%22%3A1272657600%2C%22secret%22%3A%22tWgd0DoIWXHAHmdjqsNesw__%22%2C%22access_token%22%3A%22108867472487808|2.tWgd0DoIWXHAHmdjqsNesw__.3600.1272657600-827400426|qnjnH_Zwc0WVnsV1lvwoYy2fjvk.%22%2C%22sig%22%3A%22c20aee6f5d79c30d70f01925b14c2530%22}

If I afterwards click back, the application front page loads correctly.

 

Developer
May 3, 2010 at 3:51 PM
yannickhammens and NorwegianWood We are seeing similar things and what we are doing to solve problem is doing a canvas redirect to apps.facebook.com/appname/action I think there is a bug with new data permissions and in an iframe app as this doesn't seem to be a problem in fbml apps. I am looking through facebook forums to find a solution to this. Thanks, Jim
Developer
May 4, 2010 at 3:45 PM

With bfwiards fix by adding canvas to the login url, it now redirects properly.  I also took out the need of having the have the suffix defined in the canvas session.

 

May 11, 2010 at 5:43 PM
I have just downloaded the newest version and it works fine when I start my iFrame app and make log in on Facebook. But when I am already logged and then start from localhost i.e. by calling "http://localhost/" the app is not opened in Facebook iFrame. Do I need to set additional properties in web.config and Developer app? Thanks in advance !!
May 18, 2010 at 4:28 AM

hi, where can i download the SDK binaries for 50154?

May 21, 2010 at 11:36 PM

June 1 is approaching and we have over 100 applications on Facebook which will all break with the new data permissions changes. Anyone trying to add an application will get the error message outlined above regarding the NextURL parameter. Is anyone at Microsoft, Clarity Consulting or part of this forum planning on releasing a fix for this prior to the deadline or are we on our own? We have considered migrating our codebase to php for sometime now. Microsoft and Facebook announced that this would be a supported SDK. Is it supported or is the developer community on its own when it comes to breaking fixes?

Thanks

 

Developer
May 22, 2010 at 12:15 AM
wsarris wrote:

June 1 is approaching and we have over 100 applications on Facebook which will all break with the new data permissions changes. Anyone trying to add an application will get the error message outlined above regarding the NextURL parameter. Is anyone at Microsoft, Clarity Consulting or part of this forum planning on releasing a fix for this prior to the deadline or are we on our own? We have considered migrating our codebase to php for sometime now. Microsoft and Facebook announced that this would be a supported SDK. Is it supported or is the developer community on its own when it comes to breaking fixes?

Thanks

 

I don't work for Microsoft or Clarity Consulting, but I did put in a couple of patches a couple of weeks ago that allows you to use both old data and new data permissions.  We have a few Facebook apps in production using this toolkit with the new facebook data permissions set.  I will double check that i have all the extended permissions checked in also as we have branched and have been fixing things as we run into them.  If you get latest, it will work from the source tree.

 

May 23, 2010 at 4:58 PM

Thanks Jimzim. Bu we downloaded your changeset and the binaries are much smaller in size than the existing. When using them, our sites do not work.

May 23, 2010 at 5:14 PM

Jimzim. Would it be possible for you to compile your latest version and post a link to the binaries?

Developer
May 23, 2010 at 5:48 PM

Yeah i can post them later tonight when i am by my computer.  What version were you using before?  Also are you creating fbml or iframe apps?  Also webforms or mvc?

May 23, 2010 at 8:34 PM

jimzin,

We are using the last release version, 3.0. But we would be intereseted in any upgraes you've made since then, so your current version would be fine. We are using fbml and webforms, following the sample examples and deriving from Facebook.Web.CanvasFBMLMasterPage for the Master and Facebook.Web.CanvasFBMLBasePage for the content pages.

 

Thanks

<font size="2">

 

</font> 

May 23, 2010 at 10:38 PM

jimzim,

By diffing the recent posts, I found the call where the url was changed. Couldn't use any recent builds, because the svn doesn't pull from the repository. Seems that the latest contributors have been uploading their own source bindings and everyone uses a different source binding. So, I went back to rpowers' most recent upload, which is not bound and worked from there. Changed the GetLoginURL method and now the apps work again. No need for the binaries. Thanks for the help.

 

Developer
May 24, 2010 at 3:55 AM

wsarris, Glad to hear you got it working.  I was wondering why i could not use svn.  I have been having to use tfs explorer ever since i started committing.  Can you tell where it started to break for svn with the bindings?  I would like to see if we can get that set up right so people can use svn.

I am going to be adding the rest of the new data permissions tomorrow also so that people can take advantage of the new settings at least.  A lot needs to be done, but most important is getting this toolkit to work with new data permissions.

 

May 26, 2010 at 8:05 PM

Looks like Facebook gave us a reprieve until June 30 for migrating existing apps:  http://developers.facebook.com/blog/post/384

 

Jun 7, 2010 at 4:51 PM

I have just downloaded the latest version, took the Iframe sample filled in the correct information in the web.config and I got the following error?

> API Error Code: 100
> API Error Description: Invalid parameter
> Error Message: Requires valid next URL.

So I am guessing the fix was never added?  If I do the following

 Your App -> Settings -> Migrations -> "New Data Permissions" -> Disabled

The example app then works?  But as above it seems this will only work until June 30?  What is everyone else doing about this problem?  This is my first attempt at a facebook app and now worried its not going to work past the end of this month regardless??

 

 

Jun 17, 2010 at 5:26 PM

I am in the same boat as you - all apps, including the sample app given by facebook doesn't work unless you disabled the new permissions.  I haven't seen a solution posted anywhere on what to do, so I'm not sure what the developers are thinking.

I am not sure if folks realize that extending the deadline doesn't help anything unless they fix their code.

Jun 18, 2010 at 3:00 AM

I'm also trying to use Facebook Developer Toolkit for the first time.  But I'm stuck from out of date documentation:

http://facebook.claritycon.com/help/html/64e3dc97-5125-541e-9e84-7f9303e95f25.htm

http://msdn.microsoft.com/en-us/windows/ee695841.aspx

and broken sample code.  

http://facebooktoolkit.codeplex.com/releases/view/39727#DownloadId=103962

Can anyone point me to sample code that works with the FB api changes?  

Nov 18, 2010 at 11:12 AM

when i am working with a new application with facebook an error occurred. please give a solution for this

An error occurred with APPname. Please try again later.


API Error Code: 100
API Error Description: Invalid parameter
Error Message: next is not owned by the application.

Regards Sooraj