question

alexmerza avatar image
alexmerza asked

1074 authentication when using Data API

We're using the XSolla launcher to push the session ticket to the UE4 project, this is working fine for all Client API calls, but when it comes to the Data API calls we're getting 1074. Any idea how to fix this?

PlayfabTicket = _JsonData->GetStringField("session_ticket");
auto _pFab = &IPlayFab::Get();
_pFab->setSessionTicket(PlayfabTicket);

This is how I set the session ticket for playfab client API calls.

unreal
10 |1200

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

alexmerza avatar image
alexmerza answered

Thanks to the Xsolla team, they now added the entity token to the JWT and we were able to set it via

_pFab->setEntityToken(PlayfabEntity);

Now all the API calls work properly and no longer fail the authentication.

10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

As the document Global API method error codes showed, error code 1074 means “NotAuthenticated”. To call the Client API, you need to pass SessionTicket authentication. To call the Entity API, you need to pass EntityToken authentication. The PlayFab’s Data API belongs to Entity API. You need to access Data API using EntityToken rather than using SessionTicket. Like you get the SessionTicket, you can also get the EntityToken field from the response of login methods.

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.

alexmerza avatar image alexmerza commented ·

Right, but as I mentioned, the credentials are being forwarded by the XSolla launcher and the only thing that's forwarded is the session ticket. Not the Entity Token. Is there a way to generate an entity token from the session ticket?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang alexmerza commented ·

No. It's unable to generate an entity token from the session ticket.

If you can't pass the entity token to Xsolla launcher, can you consider using classic Player Data instead of Entity Object?

0 Likes 0 ·
alexmerza avatar image alexmerza Sarah Zhang commented ·

We don't pass anything to Xsolla, the launcher is the one that does the authentication and pushes the session ticket to us instead. Trying to get an update from them which will deliver both the Entity Token as well as the Session Ticket, but wanted to get something in the interim. As it stands we have to trigger login on the launcher and then a secondary login while inside the game simply so that playfab can get the entity token.

Not sure what you mean by the classic Player Data. The reason we need the Data API is so that we can push up a file to the character used by a player. Their character picture. Only API call that does the file manipulation is through the Data API which only seems to use the Entity token for authentication.

I apologize if I'm misunderstanding.

0 Likes 0 ·
Show more comments

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.