2

Hi I'm trying to implement a new app using Parse login with facebook feature. I followed the Guide to use facebook login feature and all went ok.

Documentation states

Sessions represent an instance of a user logged into a device. Sessions are automatically created when users log in or sign up.

The problem is that I never get a valid session token when ParseFacebookUtils.logInWithReadPermissionsInBackground(...) returns (and signs up) a User which is newly created on the Parse platform (thus User.isNew() is true). Inspecting the Data dashboard I can see correctly the new _User entry but there's no entry for _Session class, whereas I should find the one with createdWith="signup" for my _User.

As a side effect when trying to logout a newly created user i get a com.parse.ParseException: Parse::UserCannotBeAlteredWithoutSessionError because, obviously, the newly created user doesn't get any session token.

If instead I perform the same operation for the same user after its creation (and therefore the User only logs in into Parse) I get a valid session token and everything's ok (which means there's a _Session object with createdWith="login" associated with the _user object).

Is this a bug or something not expected to occur? Or am I missing something? Thanks!

Currently using: facebook-android-sdk:4.0.1 + ParseFacebookUtilsV4-1.9.1.jar + Parse 1.9.0 jar

Community
  • 1
  • 1
fiipi
  • 663
  • 6
  • 20
  • I'm having the same issue. After a FB login, if I find an existing user with the same email (which I also set as the username for any user signing up by email), I confirm I have an '[FBSDKAccessToken currentAccessToken]`, then, I 'linkWithReadMePermissions ' as you did. This action seems to delete the FB Session Token, and there is no PFUser.currentUser.sessionToken either. But the user isAuthenticated = yes. And I get the same UserCannotBeAlterered error (code 206) – Mike Critchley Jan 24 '16 at 07:23
  • 1
    Hi, I did not get a solution to overcome this problem. My workaround is repeating twice the procedure, therefore when a new user gets signed up, I simply call for a login right after, and this way I manage to get a valid token. – fiipi Jan 28 '16 at 12:12

0 Answers0