import { CHAIN_NAMESPACES } from "@web3auth/base";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
const web3authCore = new Web3AuthCore({
chainConfig: { // this is ethereum chain config, change if other chain(Solana, Polygon)
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c",
blockExplorer: "https://etherscan.io/",
ticker: "ETH",
tickerName: "Ethereum"
},
});
const adapter = new OpenloginAdapter({ adapterSettings: {
network: "testnet",
clientId: {clientId} // Your clientId from Plug n play section,
uxMode: "redirect", // other option: popup
loginConfig: {
jwt: {
name: "any name",
verifier: {verifier},
typeOfLogin: "jwt",
clientId: "kGLwBvoHhQcXdT57TzdFrqG6hg5FXpee",
},
},
}});
web3authCore.configureAdapter(adapter);
await web3authCore.init();
// call below code when user clicks on login button
// it will use auth0 login with openlogin’s authentication
await web3authCore.connectTo(adapter.name, {
loginProvider: "jwt",
extraLoginOptions: {
domain: {auth0 domain},
verifierIdField: "sub",
}
});">
I am going to implement the web3auth using auth0.
I created the single application in auth0, and created the verifier using auth0.
I copied the code from the web3auth verifier, but it didn’t work.import { Web3AuthCore } from “@web3auth/core”;
import { CHAIN_NAMESPACES } from “@web3auth/base”;
import { OpenloginAdapter } from “@web3auth/openlogin-adapter”;
const web3authCore = new Web3AuthCore({
chainConfig: { // this is ethereum chain config, change if other chain(Solana, Polygon)
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: “0x1”,
rpcTarget: “https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c”,
blockExplorer: “https://etherscan.io/”,
ticker: “ETH”,
tickerName: “Ethereum”
},
});
const adapter = new OpenloginAdapter({ adapterSettings: {
network: “testnet”,
clientId: {clientId} // Your clientId from Plug n play section,
uxMode: “redirect”, // other option: popup
loginConfig: {
jwt: {
name: “any name”,
verifier: {verifier},
typeOfLogin: “jwt”,
clientId: “kGLwBvoHhQcXdT57TzdFrqG6hg5FXpee”,
},
},
}});
web3authCore.configureAdapter(adapter);
await web3authCore.init();
// call below code when user clicks on login button
// it will use auth0 login with openlogin’s authentication
await web3authCore.connectTo(adapter.name, {
loginProvider: “jwt”,
extraLoginOptions: {
domain: {auth0 domain},
verifierIdField: “sub”,
}
});
Originally posted by: polartar
Check the discussion at: https://github.com/orgs/Web3Auth/discussions/677