Sign In Register

How can we help you today?

Start a new topic
Answered

Unity leaderboard tutorial access token NOTAUTHENTICATED

Hi,


I've followed the Unity leaderboard tutorial (tutorial 2), but can't get the Facebook login to work. Starting GameSparks' test scene successfully links to the server, but adding in the access token and clicking facebookConnectRequest gives me a NOTAUTHENTICATED response:


FacebookConnectRequest.UserId:


FacebookConnectRequest.HasErrors:True


GS: RECV:{"@class":".AuthenticationResponse","error":{"accessToken":"NOTAUTHENTICATED"},"newPlayer":false,"requestId":"63555555555555512_0","scriptData":null}


GS: SEND:{"@class":".FacebookConnectRequest","accessToken":"CAAHtmADlNVoBAOFkEd5555555555555555555555555555XfvQXnBW5TsTwZDZD","requestId":"63555555555555512_0"}


(I've changed the requestIds and accessToken values).


I've tried starting from scratch twice, and I've also tried using GameSparks' Test Harness, adding the access token into the JSON code, but I still get back the NOTAUTHENTICATED response. 


If I use Facebook's Unity example scenes to login, the access token works - it gives back my name when I click on Graph Request -> Basic Request - Me buttons. 


I don't know why the access token is valid when contacting Facebook directly, but not when it goes via the GameSparks server - I'm not sure where to go from here, so any help would be appreciated.


I'm using the latest Unity SDK from both GameSparks and Facebook.


Best Answer

Hi Jenny,


Just to let you know, the Facebook issue has been addressed in our latest platform release which you can read about here. It should be working normally now. Facebook have also updated their Unity SDK recently, you might want to update that too, you can grab it here.


Thanks,

Liam


Hi Jenny
In the tutorial part 2  at the Gamesparks TestUI section after you enter your details and press test configuration.
Is the TestUI available? as highlighted by the red box in the tutorial.
If this is not available, it is what's causing the error.
The most likely reason for this is gamesparks api key or secret has been copied and pasted with an extra space at the end.
Please go to GameSparks > Edit Settings tab in Unity  and check the details are correct and no spaces at the end.

Thanks
Katie

 

Hi Katie, 


It is available - the screen I get looks like the one in the tutorial (http://i.imgur.com/pyPNtrq.png). 


Clicking on DeviceAuthenticationRequest successfully authenticates (https://lh4.googleusercontent.com/Iy9ZJ84lugvt0lRr1Uo26yS4XxevdG9eToPJG8fVS2gczp50UTq0aB3K4Jm0Nsi2_Ou1rmrhT_4eQKOdrZbR37lJaJf2NtOGu3XacSvvD6z5llvCrVXV0rBewCwXVHnEmg).


Thanks,

Jenny

Hi Jenny

Facebook needs to be integrated in the GameSparks developer portal.

In the portal go to Configurator on the top of the left side panel.

Then integrations, in the Facebook tab click edit and enter your Facebook app id and secret.

You should be able to connect to facebook in the test harness and unity now.

Thanks

Katie


Hi Katie,


Thanks, but I've already done that - both the app id and secret are already there. 


Thanks,

Jenny

Hi Jenny

Can you perform the following steps in order to test your setup ? On Facebook go to your App, then go to "Roles" and then "Test Users" in the top right, create a test user and set "Authorize Test Users for This App?" to yes and create one, then click edit beside their name get an access token for that user. Go back to the test harness and perform a FacebookConnectRequest with that token and it should work.


Thanks

Katie

Hi Katie,


It still doesn't work. I get the same NOTAUTHENTICATED response as before both via the Test Harness and via Unity. The Test Harness gives the following:


{
 "@class": ".AuthenticationResponse",
 "error": {
  "accessToken": "NOTAUTHENTICATED"
 },
 "newPlayer": false,
 "scriptData": null
}


Thanks,
Jenny

Hi Jenny

The error you are getting in the test harness suggests the access token is wrong. Can you generate another one in Access Token tool. Access tokens are only usable for a short period and then expire, this may be what's wrong.

Thanks

Katie

Hi Katie,


I've used each one immediately after creating the access token, and as I said in my initial post, they work when using Facebook's example scenes in Unity, so I don't think them expiring can be the problem. To make sure, I've done what you've suggested - still no success on either the Test Harness or Unity, and still Facebook's example scene works fine.


Thanks,
Jenny

Any further suggestions?

Hi Jenny

Sorry for the delay in replying.
Facebook have made a slight change on their end which is causing issues when Authenticating a new Facebook user with us, we have discovered whats causing this and we're currently working on a fix which we plan to push out in the next couple of days. Currently registered users are not effected by this issue.
We'll keep you posted with any updates

Thanks
Katie

 

Thanks Katie.

Answer

Hi Jenny,


Just to let you know, the Facebook issue has been addressed in our latest platform release which you can read about here. It should be working normally now. Facebook have also updated their Unity SDK recently, you might want to update that too, you can grab it here.


Thanks,

Liam

Hi there,


I came up with the same problem. I get an NOTAUTHENTICATED error when I try to connect with Facebook.


GS: SEND:{"@class":".FacebookConnectRequest","accessToken":"Facebook.Unity.AccessToken","requestId":"635899382069264260_0"}

UnityEngine.Debug:Log(Object)


I am using the latest Gamesparks_Unity_5.3.1.157 SDK and I tried with latest FB SDK (7.3) and also with FB SDK 7.2.1


Having the same error on both FB SDK's.

Hi there.


I solved my problem. 


Thanks anyway.

Login to post a comment