question

Greg Tinney avatar image
Greg Tinney asked

Is there a way to get a Photon Authentication Token for a Server (login with Secret Key)?

Hi,

So I've recently added support in our game for Photon chat. We're using it for a basic party/realtime comm system in our Unreal game and the Playfab backend.

I am using the GetPhotonAuthenticationToken() Playfab call to get authentication tokens for clients trying to connect to the Photon chat engine, which is working well. This call uses a logged-in player's SessionTicket as a basis to get a Photon authentication token.


However, there are some cases where I would like to have a cloud or gameserver also send chat messages to a player.

Does Playfab support a method to provide a Photon authentication token for a Server as well? Meaning an entity that uses a Secret key for Playfab authentication (as opposed to players that use CustomIds or username/password or 3rd party authentication).

Thanks,
-greg

sdksphotonAuthentication
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

·
Seth Du avatar image
Seth Du answered

You may create a normal player account to represent the Server like GM account in MMO games. Meanwhile you may implement any client API on the server to send messages via Client Instance API in Unity/C# SDK. For now GetPhotonAuthenticationToken API is only available in client API set, and if you have specific needs, please send a thread on the Feature Requests Forum -- https://community.playfab.com/spaces/24/index.html. Besides of Photon, PlayFab supports server-side login, but only via LoginWithServerCustomId, LoginWithSteamId, LoginWithXbox and LoginWithXboxId.

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.

Greg Tinney avatar image Greg Tinney commented ·

Thanks for the info! Yes, in this case, I was speaking more for Cloud/Azure server messages than for gameserver, as we do have realtime comm for Unreal. I was considering also using a player login from the Azure server. But photon chat from Azure functions would probably be a non-starter, due to delay in logging into Photon (and concurrent logins). Would probably need to keep a single cloud server spun up just for sending system chat messages. Which is probably only worth it once we need other always on functionality custom to our game.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Greg Tinney commented ·

I think you are right about this idea. However, as client instances have several limits, it actually is not an ideal workaround. I believe what messages that the server needs to send depends on your game design, in most scenarios, it doesn't require Photon Chat because in the end, it is only a display issue on the client side. The Server instance (either from Photon or Azure) should be able to customized the codes and send any messages to the client. The dialog texts on the clinet can have 2 data sources.

0 Likes 0 ·
Greg Tinney avatar image Greg Tinney Seth Du ♦ commented ·

Yes, we are fine regarding messages from the GameServer to Game client. By "Server" here, I mean more along the line of an Azure function "Server" needed to send a real-time message down to a client. Say if a friend request has come in, etc. Sure, push notifications can serve some of those purposes, but it is not a perfect solution, and I don't think Playfab support custom Push notifications for IOS.

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.