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 JJ · Jan 23 at 08:11 AM · CloudScriptapisdata

Find Other User in Playfab using Username

Hi. I have this feature in my game where users can search for other user based on their username (not playfabId) and find their profile, before adding them as friend.

The problem I am facing now is that, since the user only input username, I'm unable to get other information about the user, such as its avatar url (which I need to display the profile pic to my current user, so he know who he is searching for)

The workaround I have is using

PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest
        {
            Username = searchField.text	// Search field is the text the user enters
        }

and in my json configuration, I allow the current user to actually access other user's information with a rule, so I can get the account info of a random user (as long as the username matches).

The problem here is that, I would need to make another call to get the avatar URL (through GetPlayerProfile) using the playfab id I've received in this case.

To summarize, I can find a way around it, but it seems quite inefficient as I'm making multiple calls and potentially introducing a security risk.

Are there any solution to this?

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 · Jan 25 at 06:07 AM

The current behavior is by-design, and I believe you may need a workaround solution to this. Using Cloud Script/Azure Function (CSAF) will be a recommended way. Since you have a specific “Rule” in your game, you may implement a CSAF where the client will send the DisplayName as parameter to the function and the additional Profile-retrieval APIs will be called in the function after the “Rule” has been verified. The clients will simply received any information you have coded to process in the function.

Comment

People who like this

0 Show 0 · 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

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

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    Best solution for accessing TITLE INTERNAL DATA 1 Answer

    Creating Item And Adding Data 1 Answer

    How do data value update limits work? 1 Answer

    Saving data in Unity on Pause/Quit/Lose Focus 1 Answer

    UnlockContainer and CloudScriptAPIRequestError 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