# \[Archive\] Single Factor Auth Error - Unable to resolve enough promises

**URL:** <https://builder.metamask.io/t/archive-single-factor-auth-error-unable-to-resolve-enough-promises/2019>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [March 26, 2023, 4:41pm UTC](https://builder.metamask.io/t/archive-single-factor-auth-error-unable-to-resolve-enough-promises/2019 "2023-03-26T16:41:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogdanpurnavel](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bogdanpurnavel](https://builder.metamask.io/u/bogdanpurnavel)\
**Post date:** [March 26, 2023, 4:41pm UTC](https://builder.metamask.io/t/archive-single-factor-auth-error-unable-to-resolve-enough-promises/2019/1 "2023-03-26T16:41:50Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **bogdanpurnavel** on 3/26/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

Hello, i’m trying to implement the single factor auth using custom jwt but some wierd error happens. When i use the `node-sdk` with same code but the import from `node-sdk` seems to be working.

- SDK Version:

```auto
"@web3auth/single-factor-auth": "^5.1.0"

```

- Platform:  
React with Vite and TS.

- Browser Console Screenshots:

[![Screenshot 2023-03-26 at 19.36.54](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/8/82879636afa536785cd8ae8e30b5bc08f8ea8c59.png)
Screenshot 2023-03-26 at 19.36.541862×1610 145 KB
](https://community.web3auth.io/community/community/uploads/default/original/1X/84d6e15b957df0f86e1d1be89dec213dd9919b9a.png "Screenshot 2023-03-26 at 19.36.54")

JWKS endpoint is [https://a11b-2a02-2f0d-602-fa00-54be-f85b-380b-e0f2.ngrok.io/.well-known/jwks.json](https://a11b-2a02-2f0d-602-fa00-54be-f85b-380b-e0f2.ngrok.io/.well-known/jwks.json) but it works only when my laptop is online 😄 so here are the contents:

```auto
{
  "keys": [
    {
      "kty": "RSA",
      "e": "AQAB",
      "n": "vcx_9vckbEsZaAgWEjj1MRmx2y3hwgqxkVGRk4r2Ar7pRfPAqPaDt2TDZugWWlxkImNBobNsG5dY1hiWeQaNzwtxy3lAuUHQhRNjAN3KUWb-PhW53RRtpQ8ZJ2nFvaR3ZRjb8Kb1veEQcLoUDJcoe7LsODh-P_5EfMhjlnPEd5QCLcPO7AUVdT5Ft6iB_EHOzjdgjtLnPoc5IMSpPIGukIctIZXVgQmM1xzoXW6N1lTRoh3Nj2YJQp8fEmUq6KvbLQyLpUkRON2CJt-Muygr5RbFi_qkafRsLZRhffy-mzD4YBRWTklsLVhC32inxTMwxgzYHlJW0UTrPSRUpXI6SQ==",
      "use": "sig",
      "kid": "0904f1a8-ae89-4f0f-9277-1dab58287593",
      "alg": "RS256"
    }
  ]
}

```

- Verifier Name: wam-test-2

- JWKS Endpoint: [https://a11b-2a02-2f0d-602-fa00-54be-f85b-380b-e0f2.ngrok.io/.well-known/jwks.json](https://a11b-2a02-2f0d-602-fa00-54be-f85b-380b-e0f2.ngrok.io/.well-known/jwks.json)

- Sample idToken(JWT) `eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjA5MDRmMWE4LWFlODktNGYwZi05Mjc3LTFkYWI1ODI4NzU5MyJ9.eyJzdWIiOiI2ZTE4NWE4Ni00ZTUyLTQzMWYtYjk2OC0xZmExODM2ODc4MGQiLCJuYW1lIjoiVFlrb21UdENYTyIsImF1ZCI6InVybjphMTFiLTJhMDItMmYwZC02MDItZmEwMC01NGJlLWY4NWItMzgwYi1lMGYyLm5ncm9rLmlvIiwiaXNzIjoiaHR0cHM6Ly9hMTFiLTJhMDItMmYwZC02MDItZmEwMC01NGJlLWY4NWItMzgwYi1lMGYyLm5ncm9rLmlvIiwiaWF0IjoxNjc5ODQ4NTgxLCJleHAiOjE2ODAyNTE1NTF9.DoPmgVnYC7uLBbwWLkigcrIZ12OGbhsntmy2FFcYRgiszBp9msODMTuBakASzwGNIik32emWPf-HToIRBpCRcHvDDXlD04cPObxEPncmCXzuWJFqBqB73KUwfD6lva2gT0j7dxpFFxQgt01-bgUFoOByELCSXKCg3DStg5I3WleutQtIhPaxcjBobiK6lpOUHDUNhWMta88PCf_nY6fkrqcnDNXFoT4EZF4F4DaluY1Nw7gKAB-elu_qqhqFMn_5onVCIfjiu845sJFowqpgBk5HliBvzyg0Vinnj95uSemAfbe8R-QYfU2DlBnmGi6nboO_HN-c6bQERKeSRkEl7g`

- Code:

```auto
import { Web3Auth } from "@web3auth/single-factor-auth";
const connect = async () => {
const web3auth = new Web3Auth({
clientId: ‘MY_CLIENT_ID’,
chainConfig: {
chainNamespace: “eip155”,
chainId: “0x1”,
rpcTarget: “https://rpc.ankr.com/eth”,
},
web3AuthNetwork: “testnet”,
});
web3auth.init();

const provider = await web3auth.connect({
  verifier: "wam-test-2",
  verifierId: "6e185a86-4e52-431f-b968-1fa18368780d",
  idToken: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjA5MDRmMWE4LWFlODktNGYwZi05Mjc3LTFkYWI1ODI4NzU5MyJ9.eyJzdWIiOiI2ZTE4NWE4Ni00ZTUyLTQzMWYtYjk2OC0xZmExODM2ODc4MGQiLCJuYW1lIjoiVFlrb21UdENYTyIsImF1ZCI6InVybjphMTFiLTJhMDItMmYwZC02MDItZmEwMC01NGJlLWY4NWItMzgwYi1lMGYyLm5ncm9rLmlvIiwiaXNzIjoiaHR0cHM6Ly9hMTFiLTJhMDItMmYwZC02MDItZmEwMC01NGJlLWY4NWItMzgwYi1lMGYyLm5ncm9rLmlvIiwiaWF0IjoxNjc5NjY5Mzc2LCJleHAiOjE2ODAyNTE1NTF9.N3_gUmeUmFr3Wj5Byk6LRh1e0MT4h26xA0rNemtgm9RM1dW7iQUF7JddhewRUoGdedVPKl8GCa4vJaL4Hcv35REN1JBI8hotyBnVi-V-Ky9XOLJpk1mC2_I3rrUfF6HHmnVhJxF4ZAOoMoAkhPMI364f8vxVAMxp-XGlKWrrgi87QGcmpI9FQWPClp1cuWPMaZSIbHZ1wAY6-DtAV_DGEfN9P88Avic3FnNDqJHhXMWBjwOV-sqBLfOdK5tGRO7ESOp_2Ee6GyYm4Wbs_1U7H6CAycFBP5vVhAfJBVQAkXUZlpJ-gNEq2Qnflsqh43fL66kLfUVsZIGdVc0tNqx_Ew",
});
if(!provider) {
  console.log('============= INVALID PROVIDER ============');
  return;
}
const privateKey = await provider.request({ method: "eth_private_key" });
// The private key returned here is the CoreKitKey
console.log("ETH Private Key", privateKey);

```

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 28, 2023, 4:24am UTC](https://builder.metamask.io/t/archive-single-factor-auth-error-unable-to-resolve-enough-promises/2019/2 "2023-03-28T04:24:49Z")

</div>

Hey @bogdanpurnavel

I have tested the latest SFA SDK in [this example](https://github.com/Web3Auth/web3auth-core-kit-examples/tree/main/single-factor-auth/sfa-react-example). Could you try using this example with your configs?

---

<div class="post-metadata">

**Author:** ![bogdanpurnavel](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bogdanpurnavel](https://builder.metamask.io/u/bogdanpurnavel)\
**Post date:** [March 28, 2023, 7:40am UTC](https://builder.metamask.io/t/archive-single-factor-auth-error-unable-to-resolve-enough-promises/2019/3 "2023-03-28T07:40:20Z")

</div>

Hey @shahbaz ,

I’ve ran the example provided and it works perfectly, issue seems to be that i’m using Vite for bundling… i will mark this as resolved.
