Hey guys, I set up the Tkey aggregate provider using Auth0.
I added the sub verifier of Auth0 google as per the tutorials and initialized by following the example repo. However, at the ‘connect’ function, it gives the error [Error: Unable to resolve enough promises.]. Appreciate help asap
``
const onLogin = async () => {
try {
const idToken = await loginWithAuth0();
const parsedToken = parseToken(idToken);
await (tKey.serviceProvider as any).init(
ethereumPrivateKeyProvider,
);
const verifierId = parsedToken.sub;
const verifier = 'aggregate-test';
const subVerifiers = [{ verifier: "auth0-google", idToken: idToken }]
console.log("gothere")
console.log("Params")
console.log("verifier", verifier)
console.log("verifierId", verifierId)
console.log("idToken", idToken)
console.log("subVerifiers", subVerifiers)
const OAuthShareKey = await (
tKey.serviceProvider as SfaServiceProvider
).connect({
verifier,
verifierId,
idToken,
subVerifierInfoArray: subVerifiers
});
await tKey.initialize();
var { requiredShares } = tKey.getKeyDetails();
console.log("requiredShares", requiredShares)
} catch (e) {
console.log("Failed", e)
}
};
- SDK Version
"@tkey/core": "^12.0.0",
"@tkey/react-native-storage": "^11.0.0",
"@tkey/security-questions": "^12.0.0",
"@tkey/service-provider-sfa": "^11.0.0",
"@tkey/share-serialization": "^12.0.0",
"@tkey/share-transfer": "^12.0.0",
"@tkey/storage-layer-torus": "^12.0.0",
- Platform: React Native
import ThresholdKey from ‘@tkey/core’;
import SFAServiceProvider from ‘@tkey/service-provider-sfa’;
import TorusStorageLayer from ‘@tkey/storage-layer-torus’;
import { ShareSerializationModule } from ‘@tkey/share-serialization’;
import { ReactNativeStorageModule } from ‘@tkey/react-native-storage’;
import * as SecureStore from “expo-secure-store”;
const clientId =
‘REDACTED I put my key here’; // get from https://dashboard.web3auth.io
export const chainConfig = {
chainId: ‘0x1’,
rpcTarget: ‘https://rpc.ankr.com/eth’,
displayName: ‘mainnet’,
blockExplorer: ‘https://etherscan.io/’,
ticker: ‘ETH’,
tickerName: ‘Ethereum’,
};
const web3AuthOptions: any = {
clientId, // Get your Client ID from Web3Auth Dashboard
chainConfig,
web3AuthNetwork: ‘sapphire_mainnet’, // [“cyan”, “testnet”]
};
// Configuration of Service Provider
const serviceProvider = new SFAServiceProvider({ web3AuthOptions });
// Instantiation of Storage Layer
const storageLayer = new TorusStorageLayer({
hostUrl: ‘https://metadata.tor.us’,
});
// Configuration of Modules
const reactNativeStorage = new ReactNativeStorageModule(SecureStore);
const shareSerialization = new ShareSerializationModule();
// Instantiation of tKey
export const tKey = new ThresholdKey({
serviceProvider,
storageLayer,
modules: {
reactNativeStorage,
shareSerialization,
},
});