Sign In Register

How can we help you today?

Start a new topic
Answered

Retrieve error values from AuthenticationResponse in AS3

Is there a way to retrieve error values (UNRECOGNISED, LOCKED) from AuthenticationResponse?


Now I am using response.HasErrors(), but it doesn't give me the values.


AuthenticationResponse WebSocketMessage:

handleWebSocketMessage{"@class":".AuthenticationResponse","error":{"DETAILS":"UNRECOGNISED"},"newPlayer":false,"requestId":"14368772916382359","scriptData":null}


Thanks!


P.S. Second day exploring GS platform. As far as I learnt, GameSparks looks awesome.


Best Answer

Found it:

if ( response.getAttribute("error").DETAILS == "UNRECOGNISED


Hi Irakli,


Glad you're enjoying GameSparks so far. All the errors you can see in an AuthenticationResponse are listed in the documentation under AuthenticationRequest. Can be seen here. Our documentation lists all the useable parameters and details all of the errors you can get when sending requests and receiving their response.


So, "Unrecognised" = The userName password combination did not match any existing account.


"Locked" = there have been too many failed login attempts with these details and the account has been locked temporarily.


Thanks,

Liam

Thanks for reply.


I know. I have read in documentation that there's two types of responses. That's why i'm interested. The problem is that I can't retrieve it from response object.


I'm using AS3 SDK.

Answer

Found it:

if ( response.getAttribute("error").DETAILS == "UNRECOGNISED

How can I get my username and password to authenticate?


Hi Mazhar,


Can you clarify where exactly you are having trouble?


Thanks,


Oisin.

Thanks for replying the problem is solved.

if ( response.getAttribute("error").DETAILS == "UNRECOGNISED)

No longer appears to be available.

I tried:
if(response.Errors == "LOCKED")

but this also does not work. How do I check whether the authentication request was rejected based on credentials verses a locked account?

I also tried:
if(response.Errors.GetString("DETAILS") == "LOCKED")

also does not work...

 

I just made a post to this forum but it has not registered... was it erased?

 

Well looks like my last post was erased, Ill write it again.

I'm trying to differentiate between an authentication error due to a wrong username and password verses one for a locked account so I can notify the user so they don't keep trying to enter their credentials when the account is locked as the OP was trying to do.

I tried:
if ( response.getAttribute("error").DETAILS == "UNRECOGNISED)
but this appears to be obsolete.

I tried:
if(response.Errors.GetString("DETAILS") == "LOCKED")
but this does not work.

How do I replicate the obsolete command:
if ( response.getAttribute("error").DETAILS == "UNRECOGNISED)

 

Hi Ian


Apologies the forum picks up on some replies to be manually applied before they can be seen.

I will look into this issue for you. What version of the GameSparks AS3 plugin are you using?


Regards

Katie

Thanks Katie, I'm using 5.4.0.104

 

Oh and I'm using Unity3D not AS3.

 

Tried:
 GSData error = response.Errors.GetGSData("DETAILS");
 Debug.Log(error);
But this prints Null.

 

I was playing around and tried:
 if(response.Errors.GetString("DETAILS") == "LOCKED")
again and it appears to be working. Thank you Katie for the quick response and looking into this for me.

On a side note, I recommend that you request that the developers add this to the GS API Documentation at:
https://api.gamesparks.net/?_ga=1.38111009.36480331.1481658988#authenticationrequest

 

Makes no sense to me why GS pays for excellent customer service but wont pay one person to sit down and write comprehensive documentation.


Regards

Ian

Login to post a comment