Getting first and last names after signing in Google via WebAuthProvider

We are in the process of allowing users of our Android app log in via Google, and we have tested WebAuthProvider and it works well. However, we’d like to have new users skip filling up their first and last names. Is it possible to obtain the first and last name from the signed-in Google account or is this not possible when using WebAuthProvider?

Hi there @admdizon !

Sorry for the delayed response here, but wanted to get back to you on this and see if you’ve had any luck?

You should be able to get the familyName and givenName of a user logged in with Google via the UserProfile. For example, it might be helpful to take a look at how this class is used in our sample app:

Hope this helps!

Hi @tyf , I wish we had known about this sooner. We went for a backend-based solution instead so that the first and last name is pre-filled when the app fetches for the user profile when that user signs in via Google.

We thought that getting the first and last name from Google from the frontend was going to be difficult because of this article: Call an Identity Provider API. Our understanding was that getting the user profile involves additional steps that involves the Auth0 management API.

In general, the Google sign-in usecase seems to be a frequent and common request from users yet I haven’t seen a clear document from Auth0 that talks about setting it up properly. A lot of info that we obtained came from trawling issues in this forum and in Github.

Hey @admdizon thanks for following up here!

Bummer, I wish I could’ve responded sooner! Anyways, I am happy to hear you were able to get it sorted regardless and that this will be available for community members moving forward. :smile:

Thanks for the feedback, always appreciated! If you are up to it, this could be a good candidate for a Feedback request here:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.