Invalid client_id parameter error while doing Slack login

When I try to login via Slack, its showing “Invalid client_id parameter” error

  • SDK Version: latest
  • Platform: windows
  • Browser Console Screenshots:
  • If the issue is related to Custom Authentication, please include the following information (optional):
    • Verifier Name: zzyy-custom-app

Here is code


  useEffect(() => {
    const init = async () => {
      try {
        const chainConfig = {
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: "0x5", // Please use 0x1 for Mainnet
          rpcTarget: "https://rpc.ankr.com/polygon",
          displayName: "Polygon Devnet",
          blockExplorer: "https://polygonscan.com",
          ticker: "MATIC",
          tickerName: "Matic",
        };

        const web3auth = new Web3AuthNoModal({
          clientId,
          chainConfig,
          web3AuthNetwork: "sapphire_devnet",
          useCoreKitKey: false,
        });

        const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });

        const openloginAdapter = new OpenloginAdapter({
          privateKeyProvider,
          adapterSettings: {
            uxMode: "redirect",
            loginConfig: {
              jwt: {
                verifier: "zzyy-custom-app",
                typeOfLogin: "jwt",
                clientId: "wQFftcjqnzIl17ycJrkV0NEsz1gHmwgK",
              },
            },
          },
        });
        web3auth.configureAdapter(openloginAdapter);
        setWeb3auth(web3auth);

        await web3auth.init();
        setProvider(web3auth.provider);

        if (web3auth.connected) {
          setLoggedIn(true);
        }
      } catch (error) {
        console.error(error);
      }
    };

    init();
  }, []);

  const login = async () => {
    if (!web3auth) {
      uiConsole("web3auth not initialized yet");
      return;
    }
    const web3authProvider = await web3auth.connectTo(
      WALLET_ADAPTERS.OPENLOGIN,
      {
        loginProvider: "jwt",
        extraLoginOptions: {
          domain: "https://dev-3p18fvnwadfbjijg.us.auth0.com",
          verifierIdField: "sub",
          connection: "sign-in-with-slack",
          // connection: "sign-in-with-slack", // Use this to skip Auth0 Modal for Google login.
        },
      }
    );
    setProvider(web3authProvider);
    // const web3 = new Web3(web3authProvider); 
  };

Can you generate a new Client ID from Auth0 and check the behavior?

I tried this, but it still showing the same error

Could you share what are the Redirect URLs you have specified in Slack?

  • Additional to your URLs for the application, please add
    https://auth.web3auth.io/auth

I have specified these two urls


What are the domains whitelisted on the Web3Auth Dashboard?

Can you add the clientID from your dashboard as clientID = “XXXXXXX-…”; here?

I haven’t whitelist any domains in Web3auth dashboard.


and I tried putting the clientID direct, just like you said, but still it’s showing the same error

   const web3auth = new Web3AuthNoModal({
          clientId :
  "BGxHWUoF_072AmPumldQ70504_KzS8X6ZqxKHxuwQwApDBGr2R3Xa2eZaFFCFp7tdZK0ndv33wuvUIFsXrvcjlE",
          chainConfig,
          web3AuthNetwork: "sapphire_devnet",
          useCoreKitKey: false,
        });

Can you have a look at this example to create your Slack App . You need to startngrok so we can access the app on an external network and create a redirect url for OAuth. It should look something like the following:

Forwarding   https://3cb89939.ngrok.io -> http://localhost:3000

Go to your app on https://api.slack.com/apps and navigate to your apps OAuth & Permissions page. Under Redirect URLs, add your ngrok forwarding address with the /slack/oauth_redirect path appended. For ex:

https://3cb89939.ngrok.io/slack/oauth_redirect

@tsayush2390 Were you able to see my previous message and configure Slack?

Yes, slack login is working now

2 Likes

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