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 apapineni · Mar 14, 2018 at 03:04 AM · Authentication

Can't login with google because the google play games services plugin for unity is returning an empty auth code

I don't think the problem is on Playfab's end but I haven't been able to login my users with google because GetServerAuthCode() for the unity GPGS plugin seems to be returning an empty string. Am I doing something wrong, or has any workaround been discovered?


I tried following the tutorial here:

https://api.playfab.com/docs/tutorials/landing-players/sign-in-with-google

But I seem to have hit this wall. GPGS seems to be signing in as well, just not getting the right auth code.


Here is my code:

// recommended for debugging:
        PlayGamesPlatform.DebugLogEnabled = true;

// Activate the Google Play Games platform
        PlayGamesClientConfiguration ClientConfiguration =
            new PlayGamesClientConfiguration.Builder()
                .RequestEmail()
                .RequestServerAuthCode(false)
                .RequestIdToken()
                .Build();
        GooglePlayGames.PlayGamesPlatform.InitializeInstance(ClientConfiguration);
        GooglePlayGames.PlayGamesPlatform.Activate();
        Social.localUser.Authenticate((bool success, string error) =>
        {
            if (success)
            {
                string serverAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode();
                PlayFabClientAPI.LoginWithGoogleAccount(new LoginWithGoogleAccountRequest()
                {
                    TitleId = TitleID,
                    ServerAuthCode = serverAuthCode,
                    CreateAccount = true
                }, (result) =>
                {
                    OnLoginSuccess(result);
                    
                }, OnLoginFailure);
            }
            else {
                GameManager.Instance.DisplayGenericError("Oops", 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
Best Answer

Answer by Brendan · Mar 14, 2018 at 06:37 AM

This seems to be an issue that comes up for a number of folks - have a look at this thread in the PlayGameServices Git: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1732

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

    1 Person is following this question.

    avatar image

    Related Questions

    Facebook/Google LogIn using the same PlayFab Account 2 Answers

    Playfab Client LinkCustomID API no Error but not linking. 1 Answer

    iOS purchases suddenly not going through anymore (error: 21004) 1 Answer

    Secure GameCenter login with UnitySDK 1 Answer

    GameServer Auth Issue 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