> For the complete documentation index, see [llms.txt](/llms.txt).

# Google sign-in with Embedded Wallets

[Google Sign-In](https://developers.google.com/identity/sign-in/web/sign-in) lets users authenticate with a Google account. Choose the default connection for the quickest setup, or configure a custom connection when you need your own Google OAuth client, consent screen, or identity provider.

## Default Google sign-in[​](#default-google-sign-in "Direct link to Default Google sign-in")

The default connection uses the Google OAuth credentials managed by Embedded Wallets. You don't need a Google Cloud project.

### Caveats[​](#caveats "Direct link to Caveats")

- The Google consent screen identifies the OAuth application managed by Embedded Wallets, not your dapp.
- You can't change the Google application configuration, such as its scopes or branding, because you don't own the credentials.
- The default connection and a custom connection are separate connections, so they produce different wallet addresses for the same person unless you link them with a [group connection](/embedded-wallets/authentication/group-connections/).

### Configure the default connection[​](#configure-the-default-connection "Direct link to Configure the default connection")

1. Open your project in the [MetaMask Developer Dashboard](https://developer.metamask.io).
2. Select **Social Connections**.
3. Enable **Google**.
![Google in the Social Connections settings](/assets/images/authentication-social-connections-39836c31a54393f4387abf946cf59a2f.png) 

The SDK reads the connection from the dashboard. You don't need to add Google credentials to your SDK configuration.

## Custom Google sign-in[​](#custom-google-sign-in "Direct link to Custom Google sign-in")

Use a custom connection when the Google authorization belongs to your dapp or an identity platform you control. You can register a Google OAuth client ID on the social connection, or run Google through Auth0, Firebase, Amazon Cognito, or your own backend.

Preserve wallet addresses

Decide between the default and a custom connection before you onboard users. Moving from the default Google connection to a custom Google, Auth0, Firebase, Amazon Cognito, or JWT connection changes every user's wallet address unless both connections are in a [group connection](/embedded-wallets/authentication/group-connections/) with matching user identifiers.

### Your Google OAuth client[​](#your-google-oauth-client "Direct link to Your Google OAuth client")

1. Follow Google's instructions to [set up an OAuth 2.0 app](https://support.google.com/cloud/answer/6158849?hl=en).
2. Add `https://auth.web3auth.io/auth` as an authorized redirect URI.  
![Google OAuth 2.0 authorized redirect URI](/img/embedded-wallets/authentication/google/google-app-redirect-uri.png)
3. Copy the OAuth client ID from the [Google Cloud console](https://console.developers.google.com/).
4. In the MetaMask Developer Dashboard, open **Social Connections**, select the settings icon next to **Google**, and enter an **Auth Connection ID** and the **Google Client ID**.
![Google connection settings](/assets/images/google-connection-69eac234bf7aae544b7816bc622dfc25.png) 

Call Embedded Wallets with `AUTH_CONNECTION.GOOGLE` and that Auth Connection ID.

### Auth0[​](#auth0 "Direct link to Auth0")

1. [Configure Google as a social connection in Auth0](https://marketplace.auth0.com/integrations/google-social-connection).
2. [Create an Auth0 connection](/embedded-wallets/authentication/custom-connections/auth0/) in the MetaMask Developer Dashboard.
3. For an implicit flow, call Embedded Wallets with the Auth0 connection ID and set the Auth0 connection name to `google-oauth2`.
4. For a JWT flow, authenticate with the Auth0 SDK, retrieve its raw ID token, and pass that token to Embedded Wallets.

### Firebase Authentication[​](#firebase-authentication "Direct link to Firebase Authentication")

1. [Enable Google sign-in in Firebase](https://firebase.google.com/docs/auth/web/google-signin).
2. [Create a Firebase connection](/embedded-wallets/authentication/custom-connections/firebase/) in the MetaMask Developer Dashboard.
3. Sign the user in with the Firebase SDK and obtain a fresh Firebase ID token.
4. Pass the Firebase ID token and your Firebase connection ID to Embedded Wallets using the JWT flow.

### Amazon Cognito[​](#amazon-cognito "Direct link to Amazon Cognito")

1. [Configure Google as a social identity provider in Amazon Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html).
2. [Create an Amazon Cognito connection](/embedded-wallets/authentication/custom-connections/aws-cognito/) in the MetaMask Developer Dashboard.
3. Authenticate through Cognito, obtain a fresh Cognito ID token, and pass it to Embedded Wallets using the JWT flow.

### Your own backend[​](#your-own-backend "Direct link to Your own backend")

1. Complete Google Sign-In in your client and send the Google ID token to your backend.
2. Validate the token against Google's token info or JWKS endpoint before trusting the identity.
3. Issue a fresh JWT with an `iat` no more than 60 seconds old and expose the signing public key through a JSON Web Key Set (JWKS) endpoint.
4. [Create a custom JWT connection](/embedded-wallets/authentication/custom-connections/custom-jwt/) that validates your issuer, audience, JWKS, and user identifier.
5. Pass your JWT and custom connection ID to Embedded Wallets.

## Group Google connections[​](#group-google-connections "Direct link to Group Google connections")

A [group connection](/embedded-wallets/authentication/group-connections/) gives the same person one wallet address across several login methods, for example Google and email passwordless.

Default Google, a native Google client ID, and Google through Auth0 or Firebase are separate connections. They produce different wallet addresses unless you group them and every connection in the group uses the same JWT user identifier (`email` or an aligned `sub`).

Pass both the child connection ID and grouped connection ID when you bypass the modal:

```
await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<GOOGLE_AUTH_CONNECTION_ID>',
  groupedAuthConnectionId: '<GROUPED_AUTH_CONNECTION_ID>',
  idToken,
})

```

## Usage examples[​](#usage-examples "Direct link to Usage examples")

The implicit examples open a Google or Auth0 authorization flow. The JWT examples assume your Auth0, Firebase, Cognito, or backend integration has already returned a fresh ID token.

### Default implicit flow

- React
- Vue
- JavaScript
- React Native
- Android
- iOS
- Flutter
- Unity
- Unreal Engine

```
import { AUTH_CONNECTION, WALLET_CONNECTORS } from '@web3auth/modal'
import { useWeb3AuthConnect } from '@web3auth/modal/react'

const { connectTo } = useWeb3AuthConnect()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.GOOGLE,
})

```

```
import { AUTH_CONNECTION, WALLET_CONNECTORS } from '@web3auth/modal'
import { useWeb3AuthConnect } from '@web3auth/modal/vue'

const { connectTo } = useWeb3AuthConnect()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.GOOGLE,
})

```

```
import { AUTH_CONNECTION, WALLET_CONNECTORS } from '@web3auth/modal'

await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.GOOGLE,
})

```

```
import { AUTH_CONNECTION, useWeb3AuthConnect } from '@web3auth/react-native-sdk'

const { connectTo } = useWeb3AuthConnect()

await connectTo({
  authConnection: AUTH_CONNECTION.GOOGLE,
})

```

```
val response = web3Auth.connectTo(
  LoginParams(AuthConnection.GOOGLE)
)

```

```
let response = try await web3Auth.connectTo(
    loginParams: LoginParams(authConnection: .GOOGLE)
)

```

```
final response = await Web3AuthFlutter.login(
  LoginParams(loginProvider: Provider.google),
);

```

```
var options = new LoginParams
{
    loginProvider = Provider.GOOGLE
};

web3Auth.login(options);

```

```
FWeb3AuthLoginParams LoginParams;
LoginParams.LoginProvider = TEXT("google");

UWeb3AuthSDK::GetInstance()->Login(LoginParams);

```

### Native custom implicit flow

Use these examples after you add your own client ID on the social connection in the dashboard. For Android and iOS, add the connection to `authConnectionConfig` during initialization. Flutter, Unity, and Unreal Engine currently use their platform's `loginConfig`; configure it by following the custom authentication guide for [Flutter](/embedded-wallets/sdk/flutter/advanced/custom-authentication), [Unity](/embedded-wallets/sdk/unity/advanced/custom-authentication), or [Unreal Engine](/embedded-wallets/sdk/unreal/advanced/custom-authentication).

- React
- Vue
- JavaScript
- React Native
- Android
- iOS
- Flutter
- Unity
- Unreal Engine

```
await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.GOOGLE,
  authConnectionId: '<AUTH_CONNECTION_ID>',
})

```

```
await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.GOOGLE,
  authConnectionId: '<AUTH_CONNECTION_ID>',
})

```

```
await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.GOOGLE,
  authConnectionId: '<AUTH_CONNECTION_ID>',
})

```

```
await connectTo({
  authConnection: AUTH_CONNECTION.GOOGLE,
  authConnectionId: '<AUTH_CONNECTION_ID>',
})

```

```
val response = web3Auth.connectTo(
  LoginParams(
    authConnection = AuthConnection.GOOGLE,
    authConnectionId = "<AUTH_CONNECTION_ID>"
  )
)

```

```
let response = try await web3Auth.connectTo(
    loginParams: LoginParams(
        authConnection: .GOOGLE,
        authConnectionId: "<AUTH_CONNECTION_ID>"
    )
)

```

```
final response = await Web3AuthFlutter.login(
  LoginParams(loginProvider: Provider.google),
);

```

```
var options = new LoginParams
{
    loginProvider = Provider.GOOGLE
};

web3Auth.login(options);

```

Configure the custom social connection in Blueprint by following the [Unreal Engine custom authentication guide](/embedded-wallets/sdk/unreal/advanced/custom-authentication).

### Auth0 implicit flow

These examples use the Auth0 custom connection configured for your SDK. Replace the connection ID and domain with your Auth0 values. For Android and iOS, add the connection to `authConnectionConfig` during initialization. Flutter, Unity, and Unreal Engine currently use their platform's `loginConfig`; configure it by following the custom authentication guide for [Flutter](/embedded-wallets/sdk/flutter/advanced/custom-authentication), [Unity](/embedded-wallets/sdk/unity/advanced/custom-authentication), or [Unreal Engine](/embedded-wallets/sdk/unreal/advanced/custom-authentication).

- React
- Vue
- JavaScript
- React Native
- Android
- iOS
- Flutter
- Unity
- Unreal Engine

```
await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<AUTH0_CONNECTION_ID>',
  extraLoginOptions: {
    connection: 'google-oauth2',
  },
})

```

```
await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<AUTH0_CONNECTION_ID>',
  extraLoginOptions: {
    connection: 'google-oauth2',
  },
})

```

```
await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<AUTH0_CONNECTION_ID>',
  extraLoginOptions: {
    connection: 'google-oauth2',
  },
})

```

```
await connectTo({
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<AUTH0_CONNECTION_ID>',
  extraLoginOptions: {
    connection: 'google-oauth2',
  },
})

```

```
val response = web3Auth.connectTo(
  LoginParams(
    authConnection = AuthConnection.CUSTOM,
    authConnectionId = "<AUTH0_CONNECTION_ID>",
    extraLoginOptions = ExtraLoginOptions(
      domain = "https://<AUTH0_DOMAIN>",
      connection = "google-oauth2"
    )
  )
)

```

```
let response = try await web3Auth.connectTo(
    loginParams: LoginParams(
        authConnection: .CUSTOM,
        authConnectionId: "<AUTH0_CONNECTION_ID>",
        extraLoginOptions: ExtraLoginOptions(
            domain: "https://<AUTH0_DOMAIN>",
            connection: "google-oauth2"
        )
    )
)

```

```
final response = await Web3AuthFlutter.login(
  LoginParams(
    loginProvider: Provider.jwt,
    extraLoginOptions: ExtraLoginOptions(
      domain: 'https://<AUTH0_DOMAIN>',
      verifierIdField: 'sub',
      connection: 'google-oauth2',
    ),
  ),
);

```

```
var options = new LoginParams
{
    loginProvider = Provider.JWT,
    extraLoginOptions = new ExtraLoginOptions
    {
        domain = "https://<AUTH0_DOMAIN>",
        verifierIdField = "sub",
        connection = "google-oauth2"
    }
};

web3Auth.login(options);

```

The current Unreal Engine SDK documentation provides this flow through Blueprint configuration, not a verified C++ example. Configure the Auth0 connection by following the [Unreal Engine custom authentication guide](/embedded-wallets/sdk/unreal/advanced/custom-authentication).

### JWT flow

Obtain a fresh ID token from your identity aggregator or backend before calling Embedded Wallets. The token issuer and claims must match the custom connection in the dashboard.

- React
- Vue
- JavaScript
- React Native
- Android
- iOS
- Flutter
- Unity
- Unreal Engine
- Node.js

```
const idToken = await getIdToken()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
const idToken = await getIdToken()

await connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
const idToken = await getIdToken()

await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
const idToken = await getIdToken()

await connectTo({
  authConnection: AUTH_CONNECTION.CUSTOM,
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

```
val response = web3Auth.connectTo(
  LoginParams(
    authConnection = AuthConnection.CUSTOM,
    authConnectionId = "<CUSTOM_CONNECTION_ID>",
    idToken = idToken
  )
)

```

```
let response = try await web3Auth.connectTo(
    loginParams: LoginParams(
        authConnection: .CUSTOM,
        authConnectionId: "<CUSTOM_CONNECTION_ID>",
        idToken: idToken
    )
)

```

```
final response = await Web3AuthFlutter.login(
  LoginParams(
    loginProvider: Provider.jwt,
    extraLoginOptions: ExtraLoginOptions(
      id_token: idToken,
    ),
  ),
);

```

```
var options = new LoginParams
{
    loginProvider = Provider.JWT,
    extraLoginOptions = new ExtraLoginOptions
    {
        id_token = idToken
    }
};

web3Auth.login(options);

```

The current Unreal Engine SDK documentation doesn't provide a verified C++ JWT example. Configure the JWT connection and login in Blueprint by following the [Unreal Engine custom authentication guide](/embedded-wallets/sdk/unreal/advanced/custom-authentication).

```
const result = await web3auth.connect({
  authConnectionId: '<CUSTOM_CONNECTION_ID>',
  idToken,
})

```

### Google One Tap JWT[​](#google-one-tap-jwt "Direct link to Google One Tap JWT")

On web, you can pass a Google One Tap credential to a custom Google connection:

App.tsx

```
const loginWithGoogle = async (response: CredentialResponse) => {
  const idToken = response.credential;

  await connectTo(WALLET_CONNECTORS.AUTH, {
    authConnectionId: "w3a-google-demo",
    authConnection: AUTH_CONNECTION.GOOGLE,
    idToken,
    extraLoginOptions: {
      isUserIdCaseSensitive: false,
    },
  });
};

...

<GoogleLogin
  onSuccess={loginWithGoogle}
  onError={() => {
    console.log("Login Failed");
  }}
  useOneTap
/>

```
