nVentimiglia
nVentimiglia

Reputation: 1908

Parse Unity Facebook 400 Bad Request

I am using the Facebook SDK and Parse plugin. I can sucessfully login with Parse and Facebook independently. When I try to 'sign up' for parse using my Facebook access token I get a 400 bad request.

I believe my parse.com account is setup correctly (I have augmented the authentication section with my application ID(s) and secret(s) (for main app and test app).

Here is my code.

        // FB Init and Login here. It works.

        var logInTask = ParseFacebookUtils.LogInAsync(FB.UserId, FB.AccessToken, DateTime.UtcNow.AddDays(1));

        while (!logInTask.IsCompleted)
        {
            yield return 1;
        }

        if (logInTask.IsCanceled || logInTask.IsFaulted)
        {
            var error = logInTask.Exception as AggregateException;
            foreach (var e in error.InnerExceptions)
            {
                // Bad Request Here
                Debug.LogError(e);

            }
        }

What am I doing wrong, how can I resolve this ?

Upvotes: 0

Views: 782

Answers (1)

Fosco
Fosco

Reputation: 38526

I suspect the issue here is that you're passing in a DateTime object for token expiration, when you should be passing in the expires_at value that came back with your Facebook login. I believe this is an integer.

Upvotes: 0

Related Questions