Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Tutorial - Authentication with Google Play Games

Discussion in 'Authentication' started by SebT_Unity, Mar 7, 2023.

  1. doublehitgames

    doublehitgames

    Joined:
    Mar 5, 2016
    Posts:
    96
    I dont understand! You're talking about?
     
  2. doublehitgames

    doublehitgames

    Joined:
    Mar 5, 2016
    Posts:
    96
    OK. Solved. I Just Generated a new Secret and configurated the Editor Autentication with this new secret. So its working now. UHUUU!
     
  3. akiluk

    akiluk

    Joined:
    Jul 25, 2023
    Posts:
    1
    I've been trying to fix this issue for 2 weeks and finally managed to do it.
    What helped me was adding tester e-mail addresses in the google play console

    I hope it helps!
     
    doublehitgames likes this.
  4. Ohilo

    Ohilo

    Joined:
    Jul 30, 2021
    Posts:
    30
    I am facing the same issue and can't seem to move forward with it. Anyone found a resolution to this?
     
  5. Ohilo

    Ohilo

    Joined:
    Jul 30, 2021
    Posts:
    30
    @SebT_Unity Thank you for collating all the information. I want to report that I have been able to get Google Play Games signin working but not the step of Linking it to a Unity Player ID.
    When I call SignInWithGooglePlayGamesAsync(authCode) I get the error as in the screenshot. Could you let me know if there is a known fix for this problem? Or else, if your team is looking into it?
     

    Attached Files:

  6. wgeorgio

    wgeorgio

    Joined:
    Nov 15, 2017
    Posts:
    31
    Is there a way to cache or keep the player logged in either with Google or other authentication?
     
  7. hanzyusuf

    hanzyusuf

    Joined:
    Dec 7, 2022
    Posts:
    1
    Finally got it working after a week ! Can't believe it was so simple. I was now under the impression that it isn't possible without publishing the app, but I'm glad I didn't need to publish just to test play game services.

    I had followed every single instruction and correctly setup my sha1 key too, and also added tester emails in the api cloud console as well as the testing section (closed testing, open testing, internal testing). The problem was that adding testers here doesn't mean anything, I had to add tester emails within the Play Games Services section. Default emails are already added, but I use another email for my personal device, and hence the problem.

    Hope someone benefits from this.

     

    Attached Files:

    Last edited: Sep 25, 2023
    njellingson and SebT_Unity like this.
  8. Diredia

    Diredia

    Joined:
    Dec 22, 2021
    Posts:
    1
    I want to use other scopes like "openid" etc.., so I Added following scope : openid.
    And Client App acquire client's auth code via RequestServerSideAccess() then served that code to backend server.
    Then backend server get access-token by using auth code.
    But ... when backend server send this access-token to endpoint "https://oauth2.googleapis.com/tokeninfo?access_token=",
    server can not know user's information(email etc..) irrelevantly of setting scope.
    Even server can not get 'Id Token'..

    Then how to backend server know user's information to make client account?
     

    Attached Files:

    Last edited: Oct 6, 2023
  9. FADEFALCON

    FADEFALCON

    Joined:
    Jun 7, 2018
    Posts:
    4
    How can ı get user email ?
     
  10. malikaran740

    malikaran740

    Joined:
    Oct 2, 2020
    Posts:
    8
    Unity Authenticator app does not work . But building the game and installing on phone does work. Pelase correct the authenticator app.

    Exception: Failed to authenticate with Google Play Games
    GooglePlayGamesServices.playLoginStart () (at Assets/Scriptes/GooglePlayGames/GooglePlayGamesServices.cs:48)
    System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <1c8569827291471e9db0dcd976e97952>:0)
    UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <f712b1dc50b4468388b9c5f95d0d0eaf>:0)
    UnityEngine.UnitySynchronizationContext.Exec () (at <f712b1dc50b4468388b9c5f95d0d0eaf>:0)
    UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <f712b1dc50b4468388b9c5f95d0d0eaf>:0)
     
  11. frozenwolfstudio9

    frozenwolfstudio9

    Joined:
    Jun 7, 2023
    Posts:
    15
    if you mange to make it work, please give me a DM or a notice, i'm stuck on the same process. The published app failes when it's authenticating the user
     
  12. ViperTechnologies

    ViperTechnologies

    Joined:
    Apr 28, 2017
    Posts:
    42
    We are stuck for weeks now, and although we have followed all steps and suggestions we are stuck, if anyone can give a helping hand and help us pass this step.

    @hanzyusuf can you please give us a hand in figuring out what we are doing wrong please?
    we basically followed every step here no luck!

    Thanks
     
    Last edited: Nov 15, 2023
  13. daruosha

    daruosha

    Joined:
    Nov 26, 2022
    Posts:
    1
    hi , we have this problem that if player not installed GooglePlayGames app , the google sign in dosnt work
     
  14. stfakdj

    stfakdj

    Joined:
    Nov 2, 2020
    Posts:
    1
    I can't understand what is Client Secret? Is that SHA-1 certificate fingerprint?
     
  15. RadwarStudios

    RadwarStudios

    Joined:
    Dec 11, 2019
    Posts:
    4
    Okay, is this a new issue we are facing? I read somewhere that Google just removed the client's secret (I'll post the link if I can find it). So now we are stuck with an empty Client Secret on the Unity Identity Providers page.