# Any clear guide on how to do Google sign-in with Lock for Android

**URL:** <https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559>\
**Category:** Get Help\
**Created:** [May 17, 2022, 7:47am UTC](https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559 "2022-05-17T07:47:06Z")\
**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 17, 2022, 7:47am UTC](https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559/1 "2022-05-17T07:47:06Z")

</div>

Hello everyone,

I am having trouble understanding how Lock for Android can accomplish Google sign-in. Our requirement is that we want to add a “Sign-in with Google” button on our app. Once the user clicks it and completes sign-in with Google, the user should automatically be registered on our app, which currently uses Auth0. Having a look at the Lock.Android Github repo, the sample app doesn’t really do anything (clicking on the button shows me failure screens). I also stumbled upon [this](https://auth0.com/docs/libraries/lock-android/lock-android-native-social-authentication) article, but comparing it with Google’s [guide](https://developers.google.com/identity/sign-in/android/sign-in) for integrating sign-in, it’s completely unclear how the two work together. The readme in the Lock for Android Github repo doesn’t have a clear step-by-step guide. Anyone here have experience integrating it successfully or am I missing something?

---

<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:** [May 17, 2022, 11:32pm UTC](https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559/3 "2022-05-17T23:32:04Z")

</div>

Hi there @admdizon welcome back!

> [@admdizon](#):
>
> I am having trouble understanding how Lock for Android can accomplish Google sign-in. Our requirement is that we want to add a “Sign-in with Google” button on our app.

Is there a particular reason you are looking to use a native flow as opposed to browser based? The reason I ask is because the browser based flow is generally recommended and also makes it super easy to implement a social login like Google. See [this article](https://auth0.com/docs/get-started/authentication-and-authorization-flow/mobile-device-login-flow-best-practices) for more information regarding native vs. browser.

> [@admdizon](#):
>
> The readme in the Lock for Android Github repo doesn’t have a clear step-by-step guide. Anyone here have experience integrating it successfully or am I missing something?

I’m unfortunately unaware of any other guide, nor have I implemented this myself. However, I can attest to [these samples](https://github.com/auth0-samples/auth0-android-sample) and the Auth0.Android [SDK](https://github.com/auth0/Auth0.Android). Using this approach (WebAuthProvider/Universal Login) allows you to configure the Google integration in your Auth0 dashboard and toggle it on in the app settings directly.

Let us know!

---

<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 17, 2022, 11:39pm UTC](https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559/4 "2022-05-17T23:39:11Z")

</div>

Hi @ty.frith , thanks for replying. I’ve read that the browser based flow is recommended, but most apps have native login options–they have options for logging in via email, or login via Facebook/Google. If I understand Lock’s usecase, using it should display an Activity that contains Google or Facebook sign-in options right?

Thank you also for linking to those samples, I will check those out.

---

<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 19, 2022, 12:34am UTC](https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559/5 "2022-05-19T00:34:54Z")

</div>

Hi @ty.frith, so to clarify, the sample code you linked should be followed if I want to do a sign-in with Google? I saw this [post](https://community.auth0.com/t/google-sign-in-integration-in-android-app-simply-stopped-working/70975) in this forum that uses WebAuthProvider as well. But I also saw another post [here](https://community.auth0.com/t/how-to-add-google-sign-in-embedded-login/55960) in this forum saying native Google sign-in is not supported. Can you clarify what this means?

edit: I think I understand what is being meant by “native Google sign-in is not supported”–it just means that Google sign-in via embedded login (presumably with `loginWithNativeSocialToken`) is still not supported.

So now I tried tinkering with the sample repo and used our existing app’s client ID and domain (in development environment, of course). And specified that I want to redirect to Google sign-in via `withConnection("google-oauth2")`:

```kotlin
WebAuthProvider.login(account)
            .withConnection("google-oauth2")
           // ...

```

and sure enough a browser opens that redirects to Google, but I am greeted with an `error 400: redirect_url_mismatch`. The error seems to indicate that we need to add a redirect URI somewhere in the Google Cloud Console. Am I in the right direction?

Edit: I will just open another topic for my questions regarding WebAuthProvider. Will be marking @ty.frith 's answer as the solution.

---

<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 3, 2022, 12:35am UTC](https://community.auth0.com/t/any-clear-guide-on-how-to-do-google-sign-in-with-lock-for-android/83559/6 "2022-06-03T00:35:31Z")

</div>

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