Authentication Error even though my keys are correct!

0 votes
Hi,

I'm getting a connection response with the resultCode WarpResponseResultCode.AUTH_ERROR when I try to connect with an arbitrary user name. What am I doing wrong?

Note: I'm sure that the API_KEY and SECRET_KEY, used for initialization, are correct.

SDK: for java

version: 1.5.5

 

I appreciate any help!

Best Regards,

kutoman
asked May 5, 2014 in AppWarp by dnny_os (16 points)

1 Answer

+1 vote
 
Best answer
There are 2 common causes for this

1) The type of App you created from the AppHq dashboard is NOT of type Warp Multiplayer. See

http://appwarp.shephertz.com/game-development-center/Using-AppHQ/#creating-an-app

2) The username you are using to connect with is already connected in your application. So 2 or more Concurrently Connected Users of your application can't have the same username.
answered May 5, 2014 by dhruvc (1,099 points)
selected May 28, 2014 by dnny_os
Thanks for the response! I missed that point.. I was confused when I had to choose the appropriate app type, anyways. Do you know if it's possible to change the app type of an existing app or delete one in the management console?
No unfortunately you can't do that. However you can disable apps from AppHq AppManager->View Apps-> toggle App State
Are you setting any recoveryAllowance?
ok. this means that the server will consider the user as paused for 60 seconds after its connection breaks. In this time, your app can call Recover API. If you call connect again in this period, the server will reject it as it already has another user with that name (paused one).
http://appwarp.shephertz.com/game-development-center/connection-resiliency/
Error 1(error auth):- Connection resiliency feature works if a running session breaks due to network problem or app toggles between background and foreground. When you kill the app it looses the session on the client side but not on the server side as recoveryAllowance was set to 60 sec. So when you are opening the app again and trying to connect with the same user name, the server will reject it as it already has another user with that name and hence you are getting auth error.

Error 2(Bad Request):- You are trying to recover the connection, but there is no local session details available to recover, i.e. recoverConnection was called for an empty session, therefore you are getting Bad Request as response.

You can check our cocos2d-x sample : https://github.com/shephertz/AppWarpCocos2DX/tree/master/Ninja_Fight_MultiplayerDemo_Cocos2dX_V3.1
You can call recoverConnection only when the error you get is connection error recoverable. If you try to call recoverConnection in another scenario it will result in bad request.

The scenario where a problem exists is when you get a recoverable connection error, the device is not connected to the internet and the user closes the app. Now when the app comes back up even if you call recover connection, it will fail as the client SDK doesn't have the unique session id anymore in its memory.

We are planning to solve this by exposing the session id to the application (via a getSessionId API) and then allowing app to call recoverConnection with a sessionId param. This way the app can save the sessionid context before it gets killed and if the app comes back within the set recovery allowance, app can call this new recoverConnection API with the saved sessionid context. This should solve the scenario.
Let us know your thoughts on this. This is a client-side fix and doesn't require any update on the server. We are planning to introduce this by June 6.
We have updated the SDK with new APIs and can be downloaded from:  https://github.com/RajeevRShephertz/AppWarpCocos2dX .

Please follow the ReadMe file to know how to use the new APIs.
Hope it will solve the problem.
I made it compatible with cocos2d-x v2.x. Please follow the same link.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...