Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Greg Tinney · Mar 10, 2021 at 02:06 AM · sdksAuthenticationphoton

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

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by SethDu · Mar 10, 2021 at 07:00 AM

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.

Comment
Greg Tinney

People who like this

1 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Greg Tinney · Mar 10, 2021 at 10:20 PM 0
Share

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.

avatar image SethDu ♦ Greg Tinney · Mar 17, 2021 at 07:14 AM 0
Share

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.

avatar image Greg Tinney SethDu ♦ · Mar 26, 2021 at 07:19 PM 0
Share

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.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Photon Custom Authentication: Returning Data to Client 1 Answer

    Photon Realtime and Chat Auth Failure 1 Answer

    Does not authenticating Photon with PlayFab pose a security risk? 1 Answer

    is Turn Base game possible with Playfab free? 1 Answer

    Can the photo selected from the gallery be specific to the user logged in with playfab and displayed in the photon rooms? 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges