prabirshrestha / FacebookSharp

Facebook Graph API for .Net
Other
30 stars 15 forks source link

FacebookUtils.ParseUrlQueryString breaks when session variable present #4

Closed jacobh0 closed 14 years ago

jacobh0 commented 14 years ago

When parsing a URL containing a serialized session object (as defined by the request string variable "session") this exception is thrown:

[KeyNotFoundException: The given key was not present in the dictionary.] System.ThrowHelper.ThrowKeyNotFoundException() +28 System.Collections.Generic.Dictionary`2.get_Item(TKey key) +7454012 FacebookSharp.FacebookUtils.ParseUrlQueryString(String query) +337 FacebookSharp.FacebookAuthenticationResult.Parse(String url, FacebookSettings facebookSettings) +710 Main.HandShake() +99 Main.Page_Load(Object sender, EventArgs e) +14 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

This issue is fixed when disabling "Canvas Session Parameter" in the Migrations tab.

prabirshrestha commented 14 years ago

can u give me the full url you are tryin to parse.

jacobh0 commented 14 years ago
http://apps.facebook.com/playerauctions/index.aspx?signed_request=TKHOVWCLf1kx-ml5Y1nMsjkJuFUbZE7V5IHc_k0RD1o.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiJ9&perms=publish_stream,email&selected_profiles=699769542&installed=1&session={%22session_key%22:%222.O3glbwKJXajUtswBzGFpOA__.3600.1281168000-699769542%22,%22uid%22:699769542,%22expires%22:1281168000,%22secret%22:%22fc5uQIzfAAmjZ2GSV18WXA__%22,%22sig%22:%225f057e24fba72a66c27ffe77c4052020%22}

Thats from the actual URL, the URL looking at the iframe source is:

http://lbetafacebook.playerauctions.com/index.aspx?signed_request=TKHOVWCLf1kx-ml5Y1nMsjkJuFUbZE7V5IHc_k0RD1o.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiJ9&perms=publish_stream%2Cemail&selected_profiles=699769542&installed=1&session=%7B%22session_key%22%3A%222.O3glbwKJXajUtswBzGFpOA__.3600.1281168000-699769542%22%2C%22uid%22%3A699769542%2C%22expires%22%3A1281168000%2C%22secret%22%3A%22fc5uQIzfAAmjZ2GSV18WXA__%22%2C%22sig%22%3A%225f057e24fba72a66c27ffe77c4052020%22%7D&signed_request=TKHOVWCLf1kx-ml5Y1nMsjkJuFUbZE7V5IHc_k0RD1o.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiJ9

Oddly enough it duplicated signed_request... nice one Facebook

prabirshrestha commented 14 years ago

is it fine now..

jacobh0 commented 14 years ago

Is what fine?

jacobh0 commented 14 years ago
http://apps.facebook.com/playerauctions/index.aspx?signed_request=TKHOVWCLf1kx-ml5Y1nMsjkJuFUbZE7V5IHc_k0RD1o.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiJ9&perms=publish_stream%2Cemail&selected_profiles=699769542&installed=1&session=%7B%22session_key%22%3A%222.KIFQ5hzMnOnIrYdqVluFEg__.3600.1281171600-699769542%22%2C%22uid%22%3A699769542%2C%22expires%22%3A1281171600%2C%22secret%22%3A%22W6U0muJN5EWINsgGRi2GGg__%22%2C%22sig%22%3A%22e9c175cb930855b5661b78eb857f29fc%22%7D

When I authorize it, it sends me there and I get the error.

Sorry, this was because I had "return_session=1" in my login url, not because of the Migration option. But as it stands it breaks when parsing because of that serialized session object (when it's present).

prabirshrestha commented 14 years ago

can u pull the latest and try FacebookSharp.Samples.CanvasIFrameApplication

in my the sample is workin fine. and i also changed the login to use the javascript version.

jacobh0 commented 14 years ago

Seems to be working fine without return_session=1 in the login URL... I don't think the problem has actually been fixed though... Only when session parsing is implemented in the library will we know for sure. Just a note, it is not required to have "Canvas Session Parameter" enabled for the iframe canvas application, only OAuth 2.0 Beta is needed.

prabirshrestha commented 14 years ago

closed