ASP.NET OpenAuth Login Failed in Facebook Page Tab

ASP.NET 4.5 supports Facebook authentication with OpenAuth. Developers who embed web applications into Facebook page tab may be faced with login failure because the page tab is rendered as an iframe and some browser will not submit cookies from iframes by default. Chrome, Firefox, Safari and Opera work fine but IE by default won’t send cookies from iframes and you will get some trouble when logging in from the Facebook page tab.

To solve this problem, you have to add the following p3p HTTP header to have IE send cookies from iframes:

Response.AddHeader(“p3p”, “CP=\”IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\””);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.