Sign In Register

How can we help you today?

Start a new topic
Answered

Error authenticating a user from AS3 project

Hello,


I have a problem with user authentication from AS3 v18 project. I register users from Test Harness. From Test Harness users are authenticated normally. I tried to authenticate from SWF (debug, standalone, mobile and web) with Preview and Live too. Nothing worked.


Error:

handleAuthenticationResponse:{"newPlayer":false,"@class":".AuthenticationResponse","error":{"DETAILS":"LOCKED"},"scriptData":null,"requestId":"14368239416663893"}



Code:

  private function startGameSparks():void
  {
   //GameSparks.initialisePreview("2*****D", "Xe*****2E", availabilityCallback);
   GameSparks.initialiseLive("2*****D", "Xe*****2E", availabilityCallback);
  }
 
  public function availabilityCallback(isAvailable:Boolean):void
  {
   traceX("availabilityCallback " + isAvailable);
   
   if(isAvailable){
      GameSparksMethods.authenticationRequest("username1", "password", handleAuthenticationResponse);
   }
  }
 
  public function handleAuthenticationResponse(response:Object):void
  {
   trace("handleAuthenticationResponse:" + JSON.stringify(response));
  }

 


Thanks,

Irakli


Best Answer

Hi Irakli,


Are you using our latest SDK?

You can find it here.


It appears you have the username and password the wrong way around here: GameSparksMethods.authenticationRequest("username1", "password", handleAuthenticationResponse);


The method signature goes like this:
public static function authenticationRequest(password:String, userName:String, callback:Function )


Thanks,


Oisin.


Today I see an error with Preview:
handleAuthenticationResponse:{"scriptData":null,"error":{"DETAILS":"UNRECOGNISED"},"newPlayer":false,"@class":".AuthenticationResponse","requestId":"14368621937155155"}


User credentials are correct. Double-checked it.

Answer

Hi Irakli,


Are you using our latest SDK?

You can find it here.


It appears you have the username and password the wrong way around here: GameSparksMethods.authenticationRequest("username1", "password", handleAuthenticationResponse);


The method signature goes like this:
public static function authenticationRequest(password:String, userName:String, callback:Function )


Thanks,


Oisin.

Aaaw... Got it.

Thanks Oisin! And sorry for stupid question. Late night work...

Login to post a comment