Created
February 10, 2011 16:59
-
-
Save ntotten/820881 to your computer and use it in GitHub Desktop.
Multi-Tenant Facebook Application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MvcApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
// Register your multi-tenant application on app startup | |
FacebookApplication.SetApplication(new MultiTenantFacebookApplication()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MultiTenantFacebookApplication : IFacebookApplication | |
{ | |
private IFacebookApplication GetCurrent() | |
{ | |
var url = HttpContext.Current.Request.Url; | |
// Get the settings based on the url or whatever | |
var simpleApp = new DefaultFacebookApplication(); | |
// Set the settings | |
return simpleApp; | |
} | |
public string AppId | |
{ | |
get { return GetCurrent().AppId; } | |
} | |
public string AppSecret | |
{ | |
get { return GetCurrent().AppSecret; } | |
} | |
public string CancelUrlPath | |
{ | |
get { return GetCurrent().CancelUrlPath; } | |
} | |
public string CanvasPage | |
{ | |
get { return GetCurrent().CanvasPage; } | |
} | |
public string CanvasUrl | |
{ | |
get { return GetCurrent().CanvasUrl; } | |
} | |
public string SiteUrl | |
{ | |
get { return GetCurrent().SiteUrl; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to host 2 facebook apps under one web app (each facebook app is a simple web page with almost the same logic so I'd like to have a web page per facebook app instead of having 2 separate web apps). Is it possible?