# Getting first and last names after signing in Google via WebAuthProvider

**URL:** <https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789>\
**Category:** Get Help\
**Tags:** android, login, auth0\
**Created:** [May 20, 2022, 7:45am UTC](https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789 "2022-05-20T07:45:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![admdizon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/admdizon/32/13075_2.png) [@admdizon](https://community.auth0.com/u/admdizon)\
**Post date:** [May 20, 2022, 7:45am UTC](https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789/1 "2022-05-20T07:45:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 13, 2022, 10:24pm UTC](https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789/3 "2022-06-13T22:24:05Z")

</div>

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](https://github.com/auth0/Auth0.Android/blob/cd9ba7460a4992aa804b940656d16977e743a347/auth0/src/main/java/com/auth0/android/result/UserProfile.kt#L10). For example, it might be helpful to take a look at how this class is used in our sample app:

> <https://github.com/auth0-samples/auth0-android-sample/blob/15233e4552c7e2c48ccf198ad290895e1ff674a4/00-Login-Kt/app/src/main/java/com/auth0/sample/MainActivity.kt#L23>

Hope this helps!

---

<div class="post-metadata">

**Author:** ![admdizon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/admdizon/32/13075_2.png) [@admdizon](https://community.auth0.com/u/admdizon)\
**Post date:** [June 15, 2022, 2:25am UTC](https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789/4 "2022-06-15T02:25:06Z")

</div>

Hi @ty.frith , 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](https://auth0.com/docs/authenticate/identity-providers/calling-an-external-idp-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.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 16, 2022, 12:00am UTC](https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789/5 "2022-06-16T00:00:18Z")

</div>

Hey @admdizon thanks for following up here!

> [@admdizon](#):
>
> 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.

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. 😄

> [@admdizon](#):
>
> 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.

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

> **[Feedback](https://community.auth0.com/c/feedback/95)**
>
> Submit and vote on product feedback and feature requests.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 1, 2022, 12:00am UTC](https://community.auth0.com/t/getting-first-and-last-names-after-signing-in-google-via-webauthprovider/83789/6 "2022-07-01T00:00:45Z")

</div>

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