i want to create an aggregate verifier with google & github auth0 social login. however, when i try to login with github, the error is
Failed to execute ‘atob’ on ‘Window’: The string to be decoded is not correctly encoded.
the error url: OpenLogin
the allowed callback url in my auth0 dashboard & the authorisation callback url in the github application is:
this is where i suspect the error lies.
below is my code snippet, following the documentation examples.
useEffect(() => {
const init = async () => {
try {
const web3auth = new Web3Auth({
clientId,
web3AuthNetwork: "testnet",
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
},
uiConfig: {
loginMethodsOrder: ["google", "github", "email_passwordless"],
}
});
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
uxMode: "popup",
loginConfig: {
// Add login configs corresponding to the provider
// Google login
google: {
name: "Google Login", // The desired name you want to show on the login button
verifier: "verifier", // Please create a verifier on the developer dashboard and pass the name here
verifierSubIdentifier: "neah-agg-google",
showOnModal: true,
typeOfLogin: "google", // Pass on the login provider of the verifier you've created
clientId: googleClientId, // use your app client id you got from google
},
// Add other login providers here
// GitHub Login via Auth0
github: {
verifier: "verifier", // Pass the Verifier name here. eg. w3a-aggregate-verifier
verifierSubIdentifier: "subverifier", // Pass the Sub-Verifier here. eg w3a-auth0
typeOfLogin: "jwt", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
clientId: auth0ClientId, // Pass the Auth0 `Client ID` here.
showOnModal: true,
jwtParameters: {
domain: auth0Domain,
verifierIdField: "email", // This is mapped b/w google and github logins.
isVerifierIdCaseSensitive: false,
},
},
}
}
});
web3auth.configureAdapter(openloginAdapter);
setWeb3auth(web3auth);
await web3auth.initModal();
if (web3auth.provider) {
setProvider(web3auth.provider);
};
} catch (error) {
console.error(error);
}
};
init();
}, []);
const login = async () => {
if (!web3auth) {
uiConsole("web3auth not initialized yet");
return;
}
var web3authProvider;
web3authProvider = await web3auth.connect();
// When user clicks GitHub button, use this to Login with GitHub via Auth0
web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "github",
});
// When user clicks Email Passwordless button, use this to Login with Email Passwordless via Auth0
web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "emailpasswordless",
});
// When user clicks Google button, use this to Login with Google
web3authProvider = await web3auth.connectTo("openlogin", {
loginProvider: "google",
});
setProvider(web3authProvider);
console.log("set provider");
};
appreciate any help!