Why separate wallets for same email in custom authentication?

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?

My code:

const openloginAdapter = new OpenloginAdapter({
          privateKeyProvider: privateKeyProvider,
          sessionTime: timeExpiration,
          adapterSettings: {
            clientId,
            uxMode: UX_MODE.POPUP,
            loginConfig: {
              google: {
                verifier: WEB3AUTH_VERIFIER,
                verifierSubIdentifier: WEB3AUTH_SUB_VERIFIER,
                typeOfLogin: 'google',
                clientId: GOOGLE_CLIENT_ID,
              },
              discord: {
                verifier: WEB3AUTH_VERIFIER,
                verifierSubIdentifier: WEB3AUTH_DISCORD_SUB_VERIFIER,
                typeOfLogin: 'discord',
                clientId: DISCORD_CLIENT_ID,
              },
            },
          },
        });

@dev.amsets Thanks for reaching out.

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",
});

Can you take a look at our examples on GitHub

Yes. I’m still getting two different accounts.

    "@web3auth/base": "^7.0.1",
    "@web3auth/ethereum-provider": "^7.0.1",
    "@web3auth/no-modal": "^7.0.1",
    "@web3auth/openlogin-adapter": "^7.0.1"

My configuration:

const initNotModal = async () => {
      try {
        const web3auth = new Web3AuthNoModal({
          clientId: clientId,
          chainConfig: {
  chainNamespace: CHAIN_NAMESPACES.EIP155,
  chainId: "0x13881",
  rpcTarget: "https://rpc.ankr.com/polygon_mumbai",
  blockExplorer: "https://mumbai.polygonscan.com/",
  displayName: "Polygon Mumbai Testnet",
  ticker: "MATIC",
  tickerName: "Matic",
},
          web3AuthNetwork:"sapphire_devnet",
        });

        const privateKeyProvider = new EthereumPrivateKeyProvider({
          config: { chainConfig: {
  chainNamespace: CHAIN_NAMESPACES.EIP155,
  chainId: "0x13881",
  rpcTarget: "https://rpc.ankr.com/polygon_mumbai",
  blockExplorer: "https://mumbai.polygonscan.com/",
  displayName: "Polygon Mumbai Testnet",
  ticker: "MATIC",
  tickerName: "Matic",
}},
        });

        const openloginAdapter = new OpenloginAdapter({
          privateKeyProvider: privateKeyProvider,
          sessionTime: timeExpiration,
          adapterSettings: {
            uxMode: UX_MODE.POPUP,
            loginConfig: {
              google: {
                verifier: WEB3AUTH_VERIFIER,
                verifierSubIdentifier: WEB3AUTH_SUB_VERIFIER,
                typeOfLogin: "google",
                clientId: GOOGLE_CLIENT_ID,
              },
              discord: {
                verifier: WEB3AUTH_VERIFIER,
                verifierSubIdentifier: WEB3AUTH_DISCORD_SUB_VERIFIER,
                typeOfLogin: "discord",
                clientId: DISCORD_CLIENT_ID,
              },
            },
          },
        });

        web3auth.configureAdapter(openloginAdapter);

        setWeb3auth(web3auth);

        await web3auth.init();
      } catch (e) {
        setWeb3auth(null);
        if (e instanceof Error) setError(e.message);
      }
    };
    initNotModal();

I’m also attaching a screenshot of my platform settings.

Is there any update on my question?

Your issue has already been forwarded to our team and will get back once there is a meaningful update to share.

Hey @dev.amsets, can you share the verifier name and based on which field are you aggregating?

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