(OAuthException - #190) Malformed access token exception
<p>I am trying to check in the customer to our cafe on Facebook using our portal on local WiFi network (the site permanently runs on local network). I am using following code that uses Facebook C# SDK:</p>

<pre><code>if (Request.QueryString["code"] != null &amp;&amp; Request.QueryString["code"] != "")
{
    string AccessToken = Request["code"].ToString();
    var fb = new FacebookClient(AccessToken);
    dynamic parameters = new ExpandoObject();
    parameters.message = "This is just a test.";
    parameters.place = "&lt;MY PAGE ID&gt;";
    dynamic result = fb.Post("me/feed", parameters);
    var id = result.id;
}
else
{
    var redirectUri = "http://&lt;LOCAL SERVER IP ADDRESS&gt;:&lt;LOCAL SERVER PORT NUMBER&gt;/FBLogin.aspx";

    var service = new FacebookClient();
    var loginUrl = service.GetLoginUrl(new
    {
        client_id = appID,
        client_secret = appSecret,
        redirect_uri = redirectUri,
        response_type = "code",
        scope = "publish_actions" // Add other permissions as needed
    });

    Response.Redirect(loginUrl.ToString());

    var fb = new FacebookClient();
    dynamic result = fb.Post("oauth/access_token", new
    {
        client_id = appID,
        client_secret = appSecret,
        redirect_uri = redirectUri
        //code = Request.QueryString["code"].ToString()
    });
}
</code></pre>

<p>I tried everything from <a href="https://stackoverflow.com/questions/21887483/malformed-access-token-190-error">this question</a> and others but I forgot the links, and nothing has worked.</p>

<p><strong>UPDATE</strong></p>

<p>I am able to check in using the access token generated directly using Facebook Debug Tool.</p>

<p>Full Exception:</p>

<blockquote>
  <p>(OAuthException - #190) Malformed access token
  AQBQAhmVl6xEYtUmSUzBCdcMq8Djzi-XgEkkFLVwUgT_v592CkhBxOiJ7xX6-PoUpvk2XRqZZ9TahXw8u7_R1qletojvnMR5ENlVTON5tzOg-6b6Mw2foGRyXUEnzNzYhc1p7bb48E9nV5NuB1tg0cFsSM2WSeSTYXnjyyuuuyxEjeqfXy1Kn0PTnIaH1s_2wuKuUCq2AdD-PyHkbj_zUADDnwZCeJk5KSHkqbcKTLgYaIk6roMWJb8xHsExJK86xbRt5jXvS2-bBLwi5dYHn_Fpc7NZjilRvNYWa2gyKSo8ElABnF3Qr051VJInVoNsXiOYTQK24tWvEqvOY_ZeKoId</p>
</blockquote>