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 robr84 · Jul 10, 2019 at 04:30 AM · unity3dAuthenticationphotonwebhooks

User not found error when trying to create a game.

Hi,

When my game starts, I authenticate Playfab with Photon as per below script. This works fine. Then not long after I log into facebook as per below script. No issues here either and everything seems to be working correctly. But then when I go to create a game, I get the error:

OnCreateRoomFailed (Failed to create game on https:xxxxxxxxx/RoomCreated?:Error response ResultCode=2 Message=User not found. Any suggestions on what may be causing this error?

Thanks in advance!

	private void AuthenticateWithPhoton(GetPhotonAuthenticationTokenResult obj) 
	{
		LogMessage("Photon token acquired: " + obj.PhotonCustomAuthenticationToken + "  Authentication complete.");

	var customAuth = new AuthenticationValues { AuthType = CustomAuthenticationType.			Custom };

	customAuth.AddAuthParameter("username", _playFabPlayerIdCache);    // expected by PlayFab custom auth service

	customAuth.AddAuthParameter("token", obj.PhotonCustomAuthenticationToken);
	PhotonNetwork.AuthValues = customAuth;

	}



    private void OnFacebookLoggedIn()
    {
        // AccessToken class will have session details
        string aToken = AccessToken.CurrentAccessToken.TokenString;
        if (facebookAccessToken.gameObject.activeSelf)
        {
            facebookAccessToken.text = AccessToken.CurrentAccessToken.TokenString;
        }
        string facebookId = AccessToken.CurrentAccessToken.UserId;
        PhotonNetwork.AuthValues = new AuthenticationValues();
        PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.Facebook;
        PhotonNetwork.AuthValues.UserId = facebookId; // alternatively set by server
        PhotonNetwork.AuthValues.AddAuthParameter("token", aToken);
        PhotonNetwork.ConnectUsingSettings();
    }

Comment

People who like this

0 Show 1
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 SethDu ♦ · Jul 11, 2019 at 01:44 AM 0
Share

May I ask are you finding players via Facebook ID? As PlayFab ID differs from Facebook ID, can you try PlayFab ID?

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by Hamza Lazaar · Jul 12, 2019 at 04:22 PM

Hi @rob84,

You need to choose either authenticate Photon clients with PlayFab or authenticate with facebook.

I recommend you login to PlayFab using facebook then authenticate Photon with PlayFab.

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

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    I'm making a payment system using XSolla and playfab in unity, to get started, I have to use which facility? Pay Station or Store? 1 Answer

    'Room created', 'Room joined' and etc. webhook from cloudscript not triggered 1 Answer

    Photon Lobby and Mirror Multiplayer Server 1 Answer

    Do I need to login every time when I reopen my game ? 1 Answer

    Google Play Sign In Doc obsolete and Apple Login/link docs inexistent 5 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