Hello team could you please check this error , we are using Single factor authentication
SomeError: Unable to resolve enough promises.
predicate: 'invalid public key result: [null,null,null,null,null] and nonce result:{} for verifier: abcdefg-verifier, verifierId: 1104572310 and extendedVerifierId: undefined ’
@sandeepnarahari49 Thanks for your recent communication.
Can you please share your Web3auth Initialization snippet and implementation code? Which framework are you using React, nodeJS, web, Anrdoid etc? Please provide more information.
Hi @vjgee
const privateKey = fs.readFileSync("privateKey.pem");
const privateKeyProvider = new EthereumPrivateKeyProvider({
config:{
chainConfig:{
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
displayName: "Ethereum Mainnet",
blockExplorer: "https://etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
}
}
})
const web3auth = new Web3Auth({
clientId: process.env.WEB3AUTH_CLIENT_ID,
web3AuthNetwork:"testnet",
})
web3auth.init( privateKeyProvider );
export async function connect(user:any, key:boolean) {
try{
const web3authsfaProvider = await web3auth.connect({
verifier,
verifierId: user.id?.toString(),
idToken:jwt.sign({
sub : user.id?.toString(),
name: user.name,
aud: "urn:api.uat.autonomy.network",
iss: "https://api.uat.autonomy.network",
iat : Math.floor(Date.now() / 1000),
exp: Math.floor(Date.now()/1000) + 60 * 60,
},
privateKey,
{ algorithm: "RS256", keyid: "1bb9605c36eYXV0b25vbXk69386830202b2d" }
)
})
const ethPrivateKey:any = await web3authsfaProvider.request({method:"eth_private_key"})
const wallet = new Wallet(ethPrivateKey)
if(key){
return ethPrivateKey
}
else return wallet.address
}catch(e){
console.error(e)
}
}
We are using Telegram id as verfierID and dependencies are
"@web3auth/ethereum-provider": "^7.0.4",
"@web3auth/single-factor-auth": "^7.0.1",
Thanks for sharing the details.
Your issue has been forwarded to our dev team and we will get back with further updates.
I have the same error using the Solana blockchain and @web3auth/node-sdk. I logged in on the frontend with the Unity SDK, then I make a call to a node.js server passing on the Web3Auth JWT Token and the user email as argument:
const web3auth = new Web3Auth({
clientId: CLIENT_API, // Get your Client ID from Web3Auth Dashboard
web3AuthNetwork: "sapphire_devnet", // Get your Network from Web3Auth Dashboard
});
const solanaProvider = new SolanaPrivateKeyProvider({
config: {
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.SOLANA,
chainId: "0x1", // Please use 0x1 for Mainnet, 0x2 for Testnet, 0x3 for Devnet
rpcTarget: myRPC,
wsTarget: "",
displayName: "Solana Mainnet",
blockExplorer: "https://explorer.solana.com",
ticker: "SOL",
tickerName: "Solana",
decimals: 9,
},
},
});
await web3auth.init({ provider: solanaProvider });
const web3authNodeprovider = await web3auth.connect({
verifier: "solcraft-auth-jwt", // e.g. `web3auth-sfa-verifier` replace with your verifier name, and it has to be on the same network passed in init().
verifierId: verifierId, // e.g. `Yux1873xnibdui` or `name@email.com` replace with your verifier id(sub or email)'s value.
idToken: idToken, // or replace it with your newly created unused JWT Token you get from your auth provider.
});
The error message looks like this:
App 17452 output: SomeError: Unable to resolve enough promises.
App 17452 output: at /home/giljowal/nodevenv/solcraft-alpha/16/lib/node_modules/@toruslabs/torus.js/dist/torusUtils.cjs.js:642:20
App 17452 output: at <anonymous> {
App 17452 output: errors: [ undefined, undefined, undefined, undefined, undefined ],
App 17452 output: responses: [ undefined, undefined, undefined, undefined, undefined ],
App 17452 output: predicate: 'invalid public key result: [null,null,null,null,null] and nonce result:{} for verifier: solcraft-auth-jwt, verifierId: g*@gmail.com and extendedVerifierId: undefined '
App 17452 output: }