I’m developing a Facebook canvas app:
- Visual Studio 2010
- .NET Framework 4.0.30319 RTMrel
- Facebook C# SDK version 5.0/5.5
- Windows 7 Home Premium
(I apologize, I tried to include images but stackoverflow denied me ‘cuz I don’t have enough posts…)
I have a solution that includes a website for the canvas app as well as the Facebook and Facebook.Web projects.
I’ve obtained a certificate (godaddy.com) and installed.
I’ve added the https binding for port 443.
I’ve set the default site and my virtual directory to use SSL.
I’ve set the secureCanvas URL in both the Facebook app settings page and the web.config file.
So, my solution compiles, the ASP.NET page shows up on the Facebook canvas but fails to authorize.
When I step through the code, FacebookWebContext.IsSecureConnection is returning “False” because _httpContext.Request.Url.Scheme is “http”.
I’ve read another post about a bug with version 5.0 of the SDK that produces this issue, so I updated my projects to version 5.5. Still no joy.
What am I missing? I’d be grateful for any suggestions, thanks!
According to source https://github.com/facebook-csharp-sdk/facebook-csharp-sdk/blob/master/Source/Facebook/FacebookClient.cs (line 157) IsSecureConnection is
And you can set it. See example (line 73):
https://github.com/facebook-csharp-sdk/facebook-canvas-aspnet-sample/blob/master/src/facebook-canvas-aspnet-sample/App_Start/NinjectMVC3.cs
Hope it help. Also you can ask your question on https://stackoverflow.com/questions/tagged/facebook-c%23-sdk