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 /
  • Bugs /
avatar image
Question by PKM · Dec 11, 2020 at 07:49 PM ·

How to get signature on LoginWithGameCenter?

I follow the link reply.

https://community.playfab.com/questions/40458/gamecenter-linking-fails-with-mysterious-error.html

but this code still not working.

How can i get signature code?

Social.localUser.Authenticate((bSuccess, msg) =>
                {
                    GameCenterSignature.Generate(OnSucceeded, OnFailed);
                });


[MonoPInvokeCallback(typeof(GameCenterSignature.OnSucceeded))]
    private static void OnSucceeded(string PublicKeyUrl, ulong timestamp, string signature, string salt, string playerID, string alias, string bundleID)
    {
        Debug.Log("Succeeded authorization to gamecenter: \n" +
            "PublicKeyUrl=" + PublicKeyUrl + "\n" +
            "timestamp=" + timestamp + "\n" +
            "signature=" + signature + "\n" +
            "salt=" + salt + "\n" +
            "playerID=" + playerID + "\n" +
            "alias=" + alias + "\n" +
            "bundleID=" + bundleID);


        var gamecenterRequest = new LoginWithGameCenterRequest()
        {
            PublicKeyUrl = PublicKeyUrl,
            Salt = salt,
            Signature = signature,
            Timestamp = timestamp.ToString(),
	    TitleId = PlayFabSettings.TitleId,
            PlayerId = playerID;
        };


	PlayFabClientAPI.LoginWithGameCenter(gamecenterRequest, result =>
                {
                    response.IsSucceeded = true;
                },
                error =>
                {
                });
     }
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

Answer by Sarah Zhang · Dec 14, 2020 at 02:53 AM

Could you please provide the specific error messages?

Comment

People who like this

0 Show 7 · 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 PKM · Dec 14, 2020 at 07:51 AM 0
Share

signature does not match authentication request data

Thank you for checking.

avatar image PKM · Dec 14, 2020 at 08:01 AM 0
Share

The error is signature does not match authentication request data.

I think, PlayFabClientAPI.LoginWithGameCenter has error. Because i used another get signature code (https://gist.github.com/BastianBlokland/bbc02a407b05beaf3f55ead3dd10f808), Also got same error. Thank you

avatar image Sarah Zhang ♦ PKM · Dec 17, 2020 at 03:03 AM 0
Share

Thanks for the reply. Typically, this error means the signature doesn't match the salt, timestamp, bundleId or playerId. You can try to check whether they are correct one by one. The bundleId is the one you set in the PlayFab Add-ons page. It should be the same as the returned bundleID.

avatar image PKM Sarah Zhang ♦ · Dec 17, 2020 at 08:27 AM 0
Share

Thanks for the cheking. I don't know about correct salt, timestamp, signature and playerId. I just know bundleId. How can i check are they one by one? Also I already set Apple in PlayFab Add-ons. Please check and reply. Thank you.

Show more comments
Show more comments
avatar image Sarah Zhang ♦ PKM · Jan 04 at 05:50 AM 0
Share

PlayFab uses the method under the Discussion of this documentation-- https://developer.apple.com/documentation/gamekit/gklocalplayer/1515407-generateidentityverificationsign to verify the signature. Could you please follow the method to verify if the hash value matches the signature parameter?

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

    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