question

Martin avatar image
Martin asked

Sudden Authentication issue (NotAuthenticated)

Greetings,

I have created a registration and login system utilizing PlayFab's CloudScript within the Unreal Engine 5.1.1 (built from source), primarily using Blueprints.

The system has been performing flawlessly throughout the day, but unfortunately, I have recently encountered an issue where I am unable to successfully call the 'ExecuteCloudScript' function. Upon attempting to do so, I am receiving the 'This API method does not allow anonymous callers.' and 'NotAuthenticated' errors.

What makes this super weird is that I have been successfully calling this function without issue until now, and I have not made any alterations to the system during this period.

I have attached two screenshots and a short video (uploaded to Imgur) showcasing the logic/issue and would appreciate any insights or solutions regarding this situation.

Thank you.

LINK to short video with Blueprint logic

5755-cloudscript-logic.png 5762-executecloudscript-error.png

CloudScriptunrealAuthentication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Xiao Zha avatar image
Xiao Zha answered

If you want to check the registration information provided by the players in CouldScript before they are logged in, PlayFab doesn’t allow such operation. The players need to be logged in first, then they can call the APIs to execute the CloudScript.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Martin avatar image Martin commented ·

Understood, thanks!

0 Likes 0 ·
Martin avatar image
Martin answered

UPDATE - It appears that the issue has been resolved, and the system is once again working.

However, the root of this issue is still unknown, so I will leave this topic as unresolved for now in case anyone would have some potential insights.

Initially, I had suspected that the problem might have originated from PlayFab itself. However, upon checking the PlayFab status, no issues were reported.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Xiao Zha avatar image Xiao Zha commented ·

In your video, it looks like you want to check the registration information provided by the player in CouldScript before calling the RegisterPlayFabUser API. Since the ExecuteCouldScript API needs a session ticket to call, and the session ticket can only be obtained after the player logged in successfully, if there is no session ticket, the ExecuteCouldScript API will report this error: "The API method does not allow anonymous callers.". So, could you please provide us with the BluePrint of the login method?

Also, if you want to add recoverable logins to anonymous accounts (players logged in with CustomID or AndroidDeviceID, etc.), you can call the AddUsernamePassword API instead of calling the RegisterPlayFabUser API. Because the RegisterPlayFabUser API will create a new account and cannot migrate the old anonymous account data into this new account.

1 Like 1 ·
Martin avatar image Martin Xiao Zha commented ·

Hi! Thank you for your response - let me clarify the situation.

I'm using the ExecuteCloudScript API to call the function that checks whether the inputted information by the user trying to register is allowed - if that's the case, then I call the RegisterPlayFabUser API to register the user.

The most confusing thing for me is the fact, that everything, including this function, has been working just fine until the point. User could just open the game, click on registration and register his new account - then login with it to the game.

But sometimes (right now as well), this error occurs and I basically can't call anything PlayFab related without getting this error back.

I now understand, that the ExecuteCloudScript API should require the session ticket, but as I mentioned above, the user who wanted to register his account to use it for login could do so without any issues before this error started happening (and there wasn't any login attempt even happening beforehand).

I have also tried calling other PlayFab APIs, but they return the same error once it begin to happen.

Here is the video with Login function

0 Likes 0 ·
Martin avatar image Martin Xiao Zha commented ·

To add some more context to why I'm doing it this way.

Initially, I had client-side checks for the inputted information during the registration. But then I figured that it could be easier bypassed by somebody who is capable of doing so - that's the reason I wanted to do all the validation logic within the CloudScript so it can't be bypassed.

If there is any better solution, I'm all ears. I would really love to use PlayFab for some important things in this project so I don't want to give up on it.

I don't really aim to have any anonymous accounts or such, since I want players to have their permanent account that they can use and login on to access their stuff.

0 Likes 0 ·
Martin avatar image Martin Xiao Zha commented ·

For now, I have decided to make the checks client-sided and call the PlayFab's Client APIs for the login and registration, that should do, at least for now.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.