In my application I am using custom authentication with aggregate type. In it I have two sub verifiers, one via google and one via discord. So my question is, if a user authorizes in google via a specific email@gmail.com or in discord they have the same email@gmail.com, then why are they two different wallets when authorizing into the system? What is aggregate for then?
Are you specifying the Client ID for the aggregate verifier from your project? Code snippet below"
import { Web3AuthNoModal } from "@web3auth/no-modal";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
const clientId = "YOUR_WEB3AUTH_CLIENT_ID";
// get it from https://dashboard.web3auth.io by creating a Plug n Play project.
const chainConfig = {
chainNamespace: "eip155",
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
displayName: "Ethereum Mainnet",
blockExplorer: "https://goerli.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
};
const web3auth = new Web3AuthNoModal({
clientId,
chainConfig,
web3AuthNetwork: "sapphire_mainnet", //or which ever environment you setup your project on
});
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
loginConfig: {
// Google login
google: {
verifier: "YOUR_AGGREGATE_VERIFIER_NAME", // Pass the Verifier name here. eg. w3a-agg-example
verifierSubIdentifier: "YOUR_FIRST_SUB_VERIFIER_NAME", // Pass the Sub-Verifier here. eg w3a-google
typeOfLogin: "google", // Pass the type of login provider.
clientId: "GOOGLE_CLIENT_ID", // Pass the Google `Client ID` here.
},
//Discord Login
discord: {
verifier: "YOUR_DISCORD_VERIFIER_NAME", // Please create a verifier on the developer dashboard and pass the name here
typeOfLogin: "discord", // Pass on the login provider of the verifier you've created
clientId: "DISCORD_CLIENT_ID_1234567890", //use your app client id you got from discord
},
},
privateKeyProvider,
});
web3auth.configureAdapter(openloginAdapter);
// Initialize
await web3auth.init();
// When user clicks Google button, use this to Login with Google
const web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "google",
});
// When user clicks Discord button, use this to Login with Discord
const web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "discord",
});