Invalid params error

I have integrated Apple login in React project using Auth0. When I am clicking on login button. it is showing this

Please help me with this

When I changed the mainnet to devnet in my project, It is showing this

Hey @tsayush2390,

According to the error message, please change the web3AuthNetwork parameter from sapphire_mainnet to sapphire_devnet. This parameter should be passed in the Web3Auth constructor during initialization.

I tried it. But is still showing error as I have shown in above reply

@tsayush2390,

Could you please share the Web3Auth initialization snippet and a screenshot of the console when you encounter the error mentioned above?

Snippet

// Web3AuthProvider.js
import React, { createContext, useContext, useEffect, useState } from "react";
import { Web3AuthNoModal } from "@web3auth/no-modal";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";

const Web3AuthContext = createContext(null);

const clientId =
  "BNwDp8_MlNS-X0gNeTCrIl0STvCVQIxYGwzxQZ6ghpzgExR58YkPfxYs5th_nwmRt_zmxPDkysc2CwiDfSKCV-c";
const chainConfig = {
  chainNamespace: "eip155",
  chainId: "0x1",
  rpcTarget: "https://rpc.ankr.com/eth",
  displayName: "Ethereum Mainnet",
  blockExplorerUrl: "https://etherscan.io",
  ticker: "ETH",
  tickerName: "Ethereum",
  logo: "https://images.toruswallet.io/ethereum.svg",
};

const Web3AuthProvider = ({ children }) => {
  const [web3auth, setWeb3auth] = useState(null);

  useEffect(() => {
    const initWeb3Auth = async () => {
      const privateKeyProvider = new EthereumPrivateKeyProvider({
        config: { chainConfig },
      });

      const web3authInstance = new Web3AuthNoModal({
        clientId,
        web3AuthNetwork: "sapphire_devnet",
        privateKeyProvider,
      });

      const openloginAdapter = new OpenloginAdapter({
        privateKeyProvider,
        adapterSettings: {
          uxMode: "redirect",
          loginConfig: {
            jwt: {
              verifier: "apple-log",
              typeOfLogin: "jwt",
              clientId: "O3DhrGQMxC3jhXQd2SSBHoyTrVb07KYU",
            },
          },
        },
      });

      web3authInstance.configureAdapter(openloginAdapter);
      setWeb3auth(web3authInstance);

      await web3authInstance.init();
    };

    initWeb3Auth();
  }, []);

  return (
    <Web3AuthContext.Provider value={{ web3auth }}>
      {children}
    </Web3AuthContext.Provider>
  );
};

export const useWeb3Auth = () => useContext(Web3AuthContext);

export default Web3AuthProvider;

Hey @tsayush2390,

Could you please have a look at the GIF and share a screenshot of the corresponding section of your Web3Auth dashboard for the verifier apple-log under the project with client ID BNwDp8_MlNS-X0gNeTCrIl0STvCVQIxYGwzxQZ6ghpzgExR58YkPfxYs5th_nwmRt_zmxPDkysc2CwiDfSKCV-c?
Screen Recording 2024-07-19 at 12.57.45.mov [video-to-gif output image]

@maharshi

This is showing in technical error details

@maharshi what should I do

Hey @tsayush2390,

I suspect the Auth0 client ID on your Auth0 dashboard might be different from the one mentioned here. This discrepancy could be causing the issue. Could you please share a screenshot of the Auth0 client ID from your Auth0 dashboard?

The Auth0 client ID is correct

Hey @tsayush2390 did you add the URLs for the application in Auth0 Tenant? https://web3auth.io/docs/guides/auth0#setup-your-auth0-tenant

@Ayush I have added these urls

It’s working now. I got the solution. There were some issue in domain. Now it is working perfectly.

Thank you @Ayush @maharshi for the help

Also, want to mention one more thing. In - https://web3auth.io/docs/auth-provider-setup/social-providers/apple#example

There’s double d (dd) in domain. This can cause issue for many users.

Great to know that it’s working, @tsayush2390. Thanks for your contribution! I’ll make the necessary changes. If you ever wish to make additions or modifications that you think would be beneficial, you can raise a PR yourself in our docs repo.

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