From 3fc483d2c9fb171bc4162a1af9439ec32c608d57 Mon Sep 17 00:00:00 2001 From: Mohammad Shahbaz Alam Date: Mon, 28 Oct 2024 10:50:48 +0530 Subject: [PATCH] Add Google via Auth0 --- .../src/App.tsx | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/web-no-modal-sdk/custom-authentication/aggregate-verifier-examples/auth0-google-aggregate-no-modal-example/src/App.tsx b/web-no-modal-sdk/custom-authentication/aggregate-verifier-examples/auth0-google-aggregate-no-modal-example/src/App.tsx index b575eaf4e..ce8a66b10 100644 --- a/web-no-modal-sdk/custom-authentication/aggregate-verifier-examples/auth0-google-aggregate-no-modal-example/src/App.tsx +++ b/web-no-modal-sdk/custom-authentication/aggregate-verifier-examples/auth0-google-aggregate-no-modal-example/src/App.tsx @@ -6,7 +6,7 @@ import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider"; import "./App.css"; //import RPC from "./evm.web3"; // import RPC from './evm.ethers'; - import RPC from './evm.viem'; +import RPC from "./evm.viem"; const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ"; // get from https://dashboard.web3auth.io @@ -66,6 +66,12 @@ function App() { typeOfLogin: "jwt", clientId: "QiEf8qZ9IoasbZsbHvjKZku4LdnRC1Ct", }, + auth0Google: { + verifier: "aggregate-sapphire", + verifierSubIdentifier: "w3a-a0-google", + typeOfLogin: "jwt", + clientId: "hiLqaop0amgzCC0AXo4w0rrG9abuJTdu", + }, }, }, }); @@ -115,6 +121,25 @@ function App() { setProvider(web3authProvider); }; + const loginAuth0Google = async () => { + if (!web3auth) { + uiConsole("web3auth not initialized yet"); + return; + } + const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.AUTH, { + loginProvider: "auth0Google", + extraLoginOptions: { + domain: "https://web3auth.au.auth0.com", + // this corresponds to the field inside jwt which must be used to uniquely + // identify the user. This is mapped b/w google and email passwordless logins of Auth0 + verifierIdField: "email", + isVerifierIdCaseSensitive: false, + connection: "google-oauth2", + }, + }); + setProvider(web3authProvider); + }; + const loginAuth0GitHub = async () => { if (!web3auth) { uiConsole("web3auth not initialized yet"); @@ -275,11 +300,14 @@ function App() { + );