Getting following error while calling connect function

i am integrating Single Factor Auth JS SDK with react native and getting this error while caliing connect function.

error : Error occurred while verifying params could not verify identity ov80MwrKGtPYczkfCDFA33laSn82 sub

token: ov80MwrKGtPYczkfCDFA33laSn82

already configured custom verifier through dashboard.

export const loginWithJWT = async (idToken) => {
console.log(“loginWithJWT function called with idToken:”, idToken ? “Token exists” : “No token”);

try {
if (!idToken) {
throw new Error(“idToken is required for login”);
}

if (!web3auth) {
  console.log("Web3Auth not initialized, initializing now...");
  await initWeb3Auth();
}

console.log("Logging in with JWT...");
// Create a login params object with all required fields
const loginParams = {
  verifier: "omofintech.app",
  verifierId: "sub",
  idToken: idToken,
};
console.log("Login params:", JSON.stringify(loginParams));

const provider = await web3auth.connect(loginParams);
console.log("Login successful, getting private key...");

const privateKey = await provider.request({ method: 'private_key' });
console.log("Private key obtained successfully");

return { provider, privateKey };

} catch (error) {
console.error(“Error in loginWithJWT:”, error);
throw error;
}
};

Hi Sumit,

Thanks for reaching out and providing detailed information on the issue you’re facing. Let’s see how we can help!

From your description, you’ve integrated the Single Factor Auth JS SDK with React Native and are running into an error related to verifying the identity during the call to the connect function.

Here’s what I gathered:

  • SDK Details: Single Factor Auth Web SDK
  • Platform: React Native
  • Error Message: “Error occurred while verifying params could not verify identity ov80MwrKGtPYczkfCDFA33laSn82 sub”
  • Custom Verifier: You’ve mentioned it’s configured through the dashboard, with the verifier set to “omofintech.app”.

To troubleshoot, please consider the following:

  1. Verifier Configuration: Double-check your verifier configuration on the Web3Auth dashboard to ensure it’s correctly set up to match the verifier and verifierId fields used in your code.

  2. JWT Token: Make sure the idToken you’re using is valid and correctly signed by the JWKS endpoint associated with your verifier. You might want to try using a tool like JWT.io to decode the token and verify its claims.

  3. Initialization of Web3Auth: Ensure that the web3auth object is correctly initialized before calling the connect function.

For more detailed guidance, you can refer to the Web3Auth Single Factor Auth SDK documentation where you can find specific setup instructions and sample configurations.

If you have further details or need additional assistance, feel free to share. We’re here to help! :blush:

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

i already checked Verifier Configuration, JWT Token and Initialization of Web3Auth. They are correctly configured.

Hey @sumitsainicbl24,

Let’s quickly decode the error:

error: Error occurred while verifying params could not verify identity ov80MwrKGtPYczkfCDFA33laSn82 sub

This usually means there’s a mismatch between the verifierId you passed and the sub value inside the JWT token.

:white_check_mark: Fix:
Parse the JWT and extract the sub field from it.
Then pass that sub value as the verifierId — instead of the string "sub".

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.