Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can't access idToken using google play plugin for unity

Discussion in 'Formats & External Tools' started by siryami, Oct 28, 2015.

  1. siryami

    siryami

    Joined:
    Feb 4, 2014
    Posts:
    4
    I am using the google play games plugin and I set up everything correctly (I'm assuming). I've ran tests and I was able to log in properly. I then tried to get the user's email, id token and access token using the example from the plugin's page:

    Debug.Log("Local user's email is " + ((PlayGamesLocalUser)Social.localUser).Email);
    Debug.Log("AccessToken is " + ((PlayGamesLocalUser)Social.localUser).accessToken);
    Debug.Log("IdToken is " + ((PlayGamesLocalUser)Social.localUser).idToken);

    I am able to get the email and access token, but the id token doesn't work. I would have thought either they all work, or they all don't. I've tested putting debug.logs before and after getting the idToken alone, nothing happens after attempting to get it.

    Any ideas what the problem might be?
     
  2. siryami

    siryami

    Joined:
    Feb 4, 2014
    Posts:
    4
    Oh, never mind. I put in the wrong client id in during the setup. I put in the games client id instead the web app's one. Switched and it works.