Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by Hullu · Mar 18, 2017 at 01:02 PM · google playloginauthenticationtoken

Get google token

How do i get google id token and access token for firebase?

I need them here:

  Firebase.Auth.Credential credential =
         Firebase.Auth.GoogleAuthProvider.GetCredential(googleIdToken, googleAccessToken);

Edit: Okey i found out that you can get token like this:

 PlayGamesPlatform.Instance.GetToken();

But when i try it on my mobile phone script gets stuck at this line... help :O

Comment
Add comment · Show 2
10 |3000 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 vdKa · Mar 29, 2017 at 12:58 PM 0
Share

Hi, did you find any solutions yet? Im looking for an answer to this issue too

avatar image key2thacity87 · May 25, 2017 at 11:50 PM 0
Share

Hullu Anyone have a decent answer for this? It seems like the answer posted is a work around.

1 Reply

· Add your reply
  • Sort: 
avatar image
5

Answer by Hullu · May 26, 2017 at 08:32 AM

This is my solution:

First setup playgames configuration like this

 PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
             .RequestIdToken()
             .Build();

 PlayGamesPlatform.InitializeInstance(config);

 PlayGamesPlatform.Activate();

Then login using

 Social.localUser.Authenticate

Now you can get token

 googleIdToken = ((PlayGamesLocalUser)Social.localUser).mPlatform.GetIdToken();

and use it to login to firebase

 Credential credential =
             GoogleAuthProvider.GetCredential(googleIdToken, null);
             auth.SignInWithCredentialAsync(credential)

I hope this helps

Comment
Add comment · Show 2 · Share
10 |3000 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 Desoxi · Jun 01, 2017 at 12:47 PM 1
Share

Did you try the google login on iOS as well? How would you retrieve the id and token there?

avatar image pankajhlwt · Dec 29, 2021 at 07:12 AM 0
Share

how to use the "playGamesClientConfigration"?

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.

Follow this Question

Answers Answers and Comments

68 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Looping Login Google Play Services 0 Answers

Unable to Login to Unity Hub With G Suite Account 0 Answers

Is there a way to set a unique token variable for each individual Unity client on download? 0 Answers

Do I need players to have accounts in order to have an IAP currency (ie. gems)? 1 Answer

Facebook login dialogue won't appear in VR projects 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges