Facebook login success, but not receiving facebook id

Hi,

Facebook login was working fine until recently. but one day, it returned error.

so I upgrade facebook SDK version from 11.0 → 16.0
now I can log in with facebook, but it created new account instead of logging in to existing account.

and when I checked on nakama console, the newly created account have no facebook id in authentication info. (please check image below)

is there any change on facebook side that cause this? here is the version info on my setup.

Nakama Client version : 3.4.1 (Unity SDK)
Nakama Server version: 3.13.1+2000e4b8
Facebook SDK version: 16.0

Thank in advance for any answer & Best regards,
Bodin

@bodin do you see any errors in the server logs? If yes can you please share them?

Hi sesposito,

Thank you very much for your reply.
I logged in with facebook auth again, and checked on server logs, but there’s no error happen there.

I tested again on API Explorer. eveything seem to be fine. I got token & refreshToken back as expected. except there’s nothing appear on the account authentication info.

I would like to bump this error since we are experiencing a similar issue. We are using FB-SDK 17 and they introduced after the ATT a need for a limited login.

Since this would be like a common flow for our users we need to take that into account.

this is the link to their SDK mentioning some issues just in case it helps: The accessToken generated by SDK 17.0.0 is Invalid: `Invalid OAuth access token - Cannot parse access token ` · Issue #2365 · facebook/facebook-ios-sdk · GitHub

but I have been trying to link facebook when the jwt token is being received after getting “success” from the login function and nothing appeared in the nakama panel. There is just a message on the docker logs saying “Checking Facebook limited Login…” and then the jwt token.

Then in consecutive attempts of login I get an error saying “409:Facebook ID is already in use.” but in the panel there is none.

Server version is v1.28.0 and sdk on client is 3.12.1].

Also, I would like to ask, what should be the correct flow to ensure that FB login can serve to recover profile from a linked account?

Profile device A → Connect to FB → Link FB to profileA
Profile device B → Connect to FB (same FB as before) → login instead of link?

Thank you so much, Regards.

1 Like

Hello @SamFashionLeague,

For subsequent login attempts are you making sure the create flag is set to false?

Let me know if the error persists, and what server version you are running (the version you provided seems incorrect).

Best.

1 Like

Hey Sesposito, thanks for your response.

We’ve updated to the latest server (nakama-common@v1.32.0) with dependencies (3.22.0 on pluginbuilder, and protobuf@v1.34.1 ) somehow it fixed all the issues.

Somehow now the jwt token works and gets validated. In Nakama panel I can see now the FB-ID associated and the link to the public picture.

I am unaware if there were some changes from nakama-common@v1.28.1 to this one but now seems fixed.

Btw, instead of setting the flag to false what I do is to recover if there is any fb-id associated to that account passing the authToken (whatever it is) and handle the flow after successful fb auth to reload the scene and get the associated profile.

try
{
    var account = await Client.GetAccountAsync(Session);
    var linkedFacebookId = account.User.FacebookId;

    if (!string.IsNullOrEmpty(linkedFacebookId))
    {
        Debug.Log($"Facebook already linked : {linkedFacebookId}");
        return;
    }

    await Client.LinkFacebookAsync(Session, authToken);
}
catch (ApiResponseException ex)
{
    Debug.LogFormat("Error linking facebook: {0}:{1}", ex.StatusCode, ex.Message);
}

Seems to work pretty well.

Thank you so much. Sam.