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 /
  • API and SDK Questions /
avatar image
Question by DP · Nov 24, 2020 at 12:36 AM · AuthenticationMatchmaking

MatchmakingEntityInvalid when calling CreateMatchMakingTicket using "title" EntityToken.

I'm attempting to create a matchmaking ticket for a player using Azure Functions/CloudScript.

Here's what I'm doing exactly:

First, I get an entity token as title from my secret key.

 {
  path: '/Authentication/GetEntityToken',
  options: {
    method: 'POST',
    body: '{"Entity":{"Id":"YYY","Type":"title"}}',
    headers: {
      'Content-Type': 'application/json',
      'X-SecretKey': 'XXX'
    }
  }
}

Next, I call CreateMatchmakingTicket

{
  path: '/Match/CreateMatchmakingTicket',
  options: {
    method: 'POST',
    body: '{"GiveUpAfterSeconds":10,"QueueName":"DefaultQueue","Creator":{"Entity":{"Id":"YYY","Type":"title_player_account"}}}',
    headers: {
      'Content-Type': 'application/json',
      'X-EntityToken': 'ZZZ
    }
  }
}

Finally, I get this response:

{
  path: '/Match/CreateMatchmakingTicket',
  result: {
    code: 403,
    status: 'Forbidden',
    error: 'MatchmakingEntityInvalid',
    errorCode: 2001,
    errorMessage: 'The entity of the caller must be one of types: title_player_account.'
  }
}

What I can intuit from this is that it is unhappy with the fact that the X-EntityToken I am using is for a "title" and not a "title_player_account". I've attempted to acquire an EntityToken for a title_player_account using my title EntityToken and I get the following error:

 {
  path: '/Authentication/GetEntityToken',
  result: {
    code: 401,
    status: 'Unauthorized',
    error: 'NotAuthorized',
    errorCode: 1089,
    errorMessage: "The claim was not allowed to perform the requested action based on the entity's access policy. Policy comment: By default, all requests are denied. If you expected this request to succeed, you may be missing a policy. See the 
permissions APIs in PlayFab's Admin Api to add a permission."
  }
}

Am I approaching this the right way? Should I just make matchmaking tickets directly from the game client itself? Should I not even be bothering with proxying this to the server-side?

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 · Nov 24, 2020 at 07:38 AM

As the error message indicates, /Match/CreateMatchmakingTicket will require a title_player_account entity token to create a ticket on AFCS, but by default the working environment holds a title-level token.

>>Should I just make matchmaking tickets directly from the game client itself?

Yes, in most scenarios, players should make matchmaking tickets directly from the clients through client API. May I ask your concerns? If you are worried about players making up the attributes in the requests on their own, you may switch the “Attribute source” in Rule settings of Queue to “Player Entity”, which will directly retrieve corresponding value from Player’s Entity Object. While Entity Object’s access policy can be modified through Global Entity Policy, and you can deny the write permission of players so that it can be completely maintained by PlayFab server.

Still, there are very specific scenarios that need to create matchmaking ticket on the server side. In that case, you may use CreateServerMatchmakingTicket instead, which is designed to be called on server side.

Comment
DP

People who like this

1 Show 1 · 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 DP · Nov 24, 2020 at 05:10 PM 0
Share

I realized recently that CreateServerMatchmakingTicket exists, I hadn't realized there was a server specific endpoint to call, mainly because the other isn't called CreateClientMatchmakingTicket so I didn't really even conceptualize there'd be a difference. Works now, thanks!

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

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    How to redeem matchmaking ticket in Thunderhead and Matchmaker (Preview)? 1 Answer

    How to properly use Client/Matchmake? Getting confusing authentication issues. 2 Answers

    Do REST API sessions time out? 9 Answers

    Receive incoming webhooks from zendesk 1 Answer

    Update/change password 1 Answer

    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