Sign In Register

How can we help you today?

Start a new topic
Answered

"error":{"authentication":"NOTAUTHORIZED"} Suddenly started happening

Hi,


I have a handful of LogEvents that are called before the user has logged in to their account. For years these events have been working fine. As of a few days ago, I am not getting this error:


"error":{"authentication":"NOTAUTHORIZED"}


when I try to call these LogEvents before the player has logged in to their account.


I'm using Unity to call the events.


The LogEvents are simply searching a runtime collection and returning the data found.


From reading online, I'm seeing that runtime collections cannot be searched by users that have not logged in to an account. If this is the case, why was it working for multiple years and now is suddenly not working? Was there an update or something?


Thanks, Ian.


Best Answer

Hi Ian,


What Jeff states above is correct. It sounds like you had a token stored locally from a previous session which allowed the SDK to re establish a connection and send the LogEvents. You shouldn't try to send this unless you know the player has authenticated. If you do, you'll likely see more of these errors.


Regards,

Liam


2 people have this question

UPDATE:


I have removed the NOTAUTHORIZED error by logging in to another account, then restarting the application. I'm happy to have a work around for when this arises during development and testing, however, why is this happening? What will my users do when/if this happens to them!? they don't have another account they can log in to, to reset the authentication system.


Please, grant me some insight as to why this is happening and how to prevent it from happening to my users.


Thanks, Ian. 

UPDATE:


I have discovered the cause of the NOTAUTHORIZED error. It appears to be caused when I delete the player account that the device had last logged in to. 

The next time I attempt to access runtime collections without being logged in, I get the NOTAUTHORIZED error and must then log in to another account to link the device with an existing player account.


Is this intentional by GameSparks or is it a bug?


just my $0.02 from a couple of years of experience with GameSparks.
You simply cannot call LogEvents without being authenticated.
However, depending on the client SDK usage, this CAN be done via limited-life session tokens that the client maintains.  So in the past, you may simply have been 'lucky' that the client connected using one of those recent/unexpired session tokens and you were able to successfully call LogEvents before a login (authentication) step.  
Dunno if that is the case here...but...

Answer

Hi Ian,


What Jeff states above is correct. It sounds like you had a token stored locally from a previous session which allowed the SDK to re establish a connection and send the LogEvents. You shouldn't try to send this unless you know the player has authenticated. If you do, you'll likely see more of these errors.


Regards,

Liam

Thanks for the replies and the clarification. I would like my users to be able to access runtime collections to identify if they already have an account linked to their current device and if so, prompt them to log in to that account. 


I suppose I can temporarily auto log them in with their device when the app starts, while still prompting them to log in with username and password. Once they submit a username and password, I can log them out of their temporary "device account" and log them in to their actual account.


Does anyone have a reason why this is not appropriate?

Login to post a comment