question

Robyn To avatar image
Robyn To asked

UE4 Authentication Context for title

I am trying to setup some local dev flows where I can have 4 Playfab player test accounts locally.

On the first run after opening the editor, everything works fine.

On subsequent runs, my GetEntityToken call fails with policy issues.

I believe this is because the AuthenticationContext is getting cached from my players.

How do I create or save an authentication context for my server/title to pass into GetEntityToken?

unrealAuthentication
10 |1200

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

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

Since you are talking about AuthenticationContext, which is not used to get Title level Entity Token(if you intend to get a Title Entity Token, just set the Developer Secret Key correctly, and leave the request of GetEntityToken empty should be fine), I assume you are trying to get a player level entity token. So, you may encounter the policy issue, when the AuthenticationContext isn’t match the Entity you specify. But, the EntityToken of the player is contained in the login result, you don’t have to call GetEntityToken to get it. May I know why you try to call GetEntityToken? As I cannot reproduce your issue, if you do need to call GetEntityToken, please provide a detailed reproduce steps for our research.

6 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.

Robyn To avatar image Robyn To commented ·

Hi @Gosen Gao, thanks for the response!

I am getting the Title Entity Token so I can do the required calls for creating backfill tickets. I have left the Authentication Context Empty, but it seems something in Unreal is changing/caching a player auth context under the hood after the first play in editor.

Screenshot for reference:

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha Robyn To commented ·

I don't see the screenshot, have you uploaded it?

0 Likes 0 ·
Robyn To avatar image Robyn To commented ·

@Xiao Zha @Gosen Gao here is the screenshot, on the first run on editor startup i get a success and on every after i get a failure. in between these calls is where i am authenticating players

0 Likes 0 ·
getentity.png (171.9 KiB)
Xiao Zha avatar image Xiao Zha Robyn To commented ·

You can directly connect Set PlayFab Settings node with Get Enity Token node like this:

Since the CreateServerBackfillTicket API should be called in server with Title Entity Token, but you mention "authenticating players", just in case, any client login method should not be called in server.

0 Likes 0 ·
getentitytoken.png (40.2 KiB)
Robyn To avatar image Robyn To Xiao Zha commented ·

Hi, yes I understand about the server/client separations here. What I am saying is that in my editor when I am running Unreal, Unreal gets confused between the client and server only pieces and the Authentication context from teh client code gets used in the server code.

This is not an issue when i build separate builds and deploy, but this is causing bugs in my local development

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.