0

How do I get the user profile information such as user name, email id, profile picture, basically all the information that is displayed in the user card, in my Javascript client?

I do not want to use the default user card that is displayed for a signed in user while using the Google Identity Toolkit.

I cannot find this information in the official documentation. The documentation does say that we can customize the look and feel of the user card, but I could not figure out how to get the profile information, which is displayed in the user card.

I'm using my own Login and Logout buttons. I would like to handle the display of user profile information in my own way too.

My application is hosted on GAE with Java.

DFB
  • 861
  • 10
  • 25

1 Answers1

0

You can use the java server library to parse the gitkit id token and retrieve all the information you need: https://github.com/google/identity-toolkit-java-client/tree/master/src/main/java/com/google/identitytoolkit

bojeil
  • 29,642
  • 4
  • 69
  • 76
  • Thanks @bojeil . Just to understand clearly, are you saying that I'll have to write my own service on the server side and Javascript has to call my service to get the user profile information? I have already included the gitkitclient library and using it for authentication in my EndPoints classes on GAE. I was trying to figure out a direct way to get the profile information from on the client side using an existing service (probably the same service that the user card is using) without having to write my own server-side code for this task. – DFB Mar 01 '16 at 06:20
  • Yeah, you will need to parse it on the backend if you wish to build it on your own. However signInSuccess callback returns the info you need. When the user successfully logs in, it returns the following parameters: 1. id token string, 2. account info, 3. optional redirect url, 4. optional oauth response. The account info object will be the most useful to you. It has the fields: 'email', 'displayName', 'photoUrl', 'providerId'. You can save that info and then use it to build your own user card. – bojeil Mar 01 '16 at 20:40