Access denied: InternalOAuthError could not authenticate you - Logging in to twitter

Hello everyone,

I hope you’re doing well. I’m currently working on an application using NextJS and the Web3Auth library. I’ve been encountering some difficulties with the Twitter login method, and I’m seeking assistance from the community to help me resolve this issue.

Problem Description:
When attempting to authenticate using the Twitter login method, I’m encountering an error message that states, “There seems to be some bug in the code. Please contact support to fix this. InternalOAuthError: Could not authenticate you.”

Code Used:

const web3AuthInstance = new Web3Auth({
  web3AuthNetwork: ${
    process.env.NEXT_PUBLIC_NODE_ENV === 'production'
      ? 'cyan'
      : 'testnet'
  },
  chainConfig: {
    chainNamespace: 'eip155',
    chainId:
      process.env.NEXT_PUBLIC_NODE_ENV === 'production'
        ? '0x89'
        : '0x13881', // hex of 137, polygon mainnet:0x89 polygon testnet: 0x13881
    rpcTarget:
      process.env.NEXT_PUBLIC_NODE_ENV === 'production'
        ? 'https://rpc.ankr.com/polygon'
        : 'https://rpc-mumbai.maticvigil.com/',
    // Avoid using public rpcTarget in production.
    // Use services like Infura, Quicknode, etc.
    displayName: 'Polygon',
    blockExplorer: 'https://polygonscan.com',
    ticker: 'MATIC',
    tickerName: 'Matic'
  },
  clientId: ${
    process.env.NEXT_PUBLIC_NODE_ENV === 'production'
      ? process.env.NEXT_PUBLIC_WEB3AUTH_KEY
      : process.env.NEXT_PUBLIC_NODE_ENV === 'development'
      ? process.env.NEXT_PUBLIC_WEB3AUTH_KEY_DEV
      : process.env.NEXT_PUBLIC_NODE_ENV === 'test' &&
        process.env.NEXT_PUBLIC_WEB3AUTH_KEY_PREVIEW
  }, // get from https://dashboard.web3auth.io
  uiConfig: {
    theme: 'dark',
    appLogo: '/logo.png',
    loginMethodsOrder: ['google', 'apple', 'facebook', 'twitter']
  }
});

const adapter = new OpenloginAdapter({
  adapterSettings: {
    uxMode: 'redirect',
    whiteLabel: {
      name: 'nameee',
      dark: true,
      logoLight: logolight.png',
      logoDark: 'logodark.png'
    }
  },
  loginSettings: {
    mfaLevel: 'none'
  }
});

I would greatly appreciate it if anyone could provide some guidance or assistance in resolving this issue. Your expertise and support are highly valued. If you require any additional information or code snippets, please let me know.

Thank you in advance for your help!

Btw: Code works in production! Just not testnet!

@francis.rousseau32 Thanks for reporting this.

We are able to replicate this error on our end and are working to fix this at the earliest.

1 Like

@francis.rousseau32 This has been fixed.

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