Facebook connect

Discussion in 'Third-party applications' started by squarerfish, Mar 9, 2010.

  1. Has anyone successfully used Facebook connect on this site?
    Admittedly, I am new to the Facebook API, but I am getting this error, and not sure if we just don't have permission on the servers to do something?

    Security Exception
    Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Source Error:
    Line 54:
    Line 55: // Load user
    Line 56: user user = _facebookAPI.Users.GetInfo();
    Line 57:
    Line 58: if (!Page.IsPostBack)

    The line the error is being thrown on is a FacebookAPI call.

    And here is the stacktrace:
    SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
    System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
    System.Security.CodeAccessPermission.Demand() +58
    System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) +147
    System.Net.HttpRequestCreator.Create(Uri Uri) +26
    System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) +216
    System.Net.WebRequest.Create(String requestUriString) +44
    Facebook.Rest.RestBase.postRequest(String requestUrl, String postString, Boolean compressHttp) +36
    Facebook.Rest.RestBase.SendRequestSynchronous(IDictionary`2 parameterDictionary, Boolean useSession) +187
    Facebook.Rest.Users.GetInfo(String uids, Boolean isAsync, GetInfoCallback callback, Object state) +311
    Facebook.Rest.Users.GetInfo(Int64 uid) +41
    Facebook.Rest.Users.GetInfo() +15
    FBConnect.Page_Load(Object sender, EventArgs e) in e:\web\frontpag\FBConnect.aspx.cs:56
    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.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
    System.Web.UI.Page.ProcessRequest() +80
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.fbconnect_aspx.ProcessRequest(HttpContext context) in App_Web_yjovv_t7.0.cs:0
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

    Thanks for any help or suggestions, or if we can or cannot do this.
  2. Last edited by a moderator: Oct 14, 2015
  3. Ray


    Good to hear it. Yeah the trust level setting typically trips up most programmers.

Share This Page