web.config Setup

Coordinator
Jun 25, 2008 at 3:18 AM
Edited Jun 25, 2008 at 3:19 AM
 
Here is a sample look at what the web.config of your MVC application should look like:
    <configSections>
    <section name="FacebookConfig" type="Facebook.Web.Config, Facebook.Web" />
    </configSections>
<!-- 
    REQUIRED OPTIONS:
    These are items required to be defined before your application will run using FacebookConfig
    
    APPKEY          = "" -> The application key Facebook assigns to your application.
    SECRETKEY       = "" -> The secret key that Facebook assigns to your application.
    APPNAME         = "FBMVC" -> the name that appears after the facebook app url or the 'Canvas Page URL' in the facebook setup
                      NOTE: This is not the true "Application Name" which Facebook requires for you to create an application.
  
    
    OPTIONAL ITEMS:
    The following options are used to retreive querystring keys (QSK)
    default values are include in FacebookConfig and examples are below.
    The purpose for defining these in the config file is because we can
    not assume Facebook will continue to use these configuration names,
    we therefore need to give ourselves an opportunity to make these
    changes without having to recompile our code.
    
    I have hardcoded the default values into the FacebookConfig class.
    However, if you set any of these properties manually, the default
    values are overriden.
    
    QSK_IN_IFRAME   = "fb_sig_in_iframe"
    QSK_IN_CANVAS   = "fb_sig_in_canvas"
    QSK_TIME        = "fb_sig_time"
    QSK_ADDED       = "fb_sig_added"
    QSK_USER        = "fb_sig_user"
    QSK_SESSION_KEY = "fb_sig_session_key"
    QSK_EXPIRES     = "fb_sig_expires"
    QSK_API_KEY     = "fb_sig_api_key"
    QSK_AUTH_TOKEN  = "auth_token"
    QSK_PROFILE_UPDATE_TIME = "fb_sig_profile_update_time"
    
    ADDITIONAL OPTIONS:
    Not required unless Facebook changes the App, Add or Login URL.
    
    USESESSION      = true or false  -> Indication of session use or not
    AUTO_ADD_APP    = true or false  -> Indicates if you want the app to be automatically added or not
    APPURL          = "http://apps.facebook.com/" -> the facebook app url - your APPNAME (which is added for you in code.)
    ADDURL          = "http://www.facebook.com/add.php?api_key=" -> The facebook add application url - your application key (which is added for you in code.)
    LOGINURL        = "http://www.facebook.com/login.php?api_key=" -> The facebook login url - your application key (which is added for you in code.)
    SK_SESSION_KEY  = "SessionKey" -> Name of the key used to store the session key into the HttpSession
    SK_USER_ID      = "UserId" -> Name of the key used to store the user id into the HttpSession
  -->
  <FacebookConfig APPNAME="yourappname"
                  APPKEY="YOUR APPLICATION KEY PROVIDED BY FACEBOOK"
                  SECRETKEY="YOUR SECRET KEY PROVIDED BY FACEBOOK"
                  ADDURL="http://www.facebook.com/add.php?api_key="
                  LOGINURL ="http://www.facebook.com/login.php?api_key="
                  QSK_AUTH_TOKEN = "auth_token"
                  USESESSION = "false" />
Jul 1, 2009 at 10:25 AM

Hi,

Thank you very much for making the toolkit.

I am trying to run the application. However I am having this error:

The URL http://localhost:8075/?auth_token=52912e7d5c08d0318f6a102c8b357139 is not valid.

I tried removing QSK_AUTH_TOKEN = "auth_token" from the <FacebookConfig >, however it still gave me that error with diff auth_token value....

 

Do you know what the problem is? Please....

Thank you,

Debsky