Suddenly log in failed

Suddenly my app failed to login in all environment(dev, stg, prd)
with error below
“Failed to connect with openlogin provider s: Non-200 status code: ‘403’”
It seems to be access error to https://rpc.ankr.com/polygon
“error”: “message: API key is not allowed to access blockchain, json-rpc code: -32052, rest code: 403”
Nothing is changed in my dashboard and application codes.
What should I do?
Please help me up.

Hello 伊藤真彦,

I’m here to help you out with this issue! It looks like you’re encountering a 403 error due to an authentication issue with the RPC provider you’re using, specifically Ankr. Here’s what you can do to resolve this:

  1. Check Ankr API Key: Ensure that your API key is valid and has access to the Polygon blockchain. There might be restrictions on your API key or rate limits being hit that are causing the request to fail.

  2. Web3Auth Documentation: Double-check the integration steps in the Web3Auth Plug-n-Play documentation to ensure everything is set up correctly on your end.

  3. Recent Changes: Verify if there have been any recent policy changes from Ankr regarding API usage. Sometimes providers update their constraints or permissions without immediate notice.

  4. Testing: Try using a different API key or create a new one to see if the problem persists. This can help identify if the issue is specifically related to the API key you’re using.

  5. Alternative Provider: Consider temporarily switching to another RPC provider like Infura or Alchemy to see if that resolves the issue.

  6. Web3Auth Custom Authentication: If you have set up any custom authentication settings, check them to make sure everything aligns with the expected configuration.

If after trying these steps the issue still persists, please provide any additional browser console screenshots or code snippets regarding the initialisation and login process as it may help in further diagnosing the problem.

Hang in there! We’ll get this sorted out. Let me know if you have any questions or need further assistance. :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

What Is Ankr API Key? Can I configure in web3auth dashboard?

Did you solve your problem ? we have the same issue.

Hey @m-ito.et, @Romain — just linking the root cause and fix here :point_down:
:link: Ankr Public RPC Discontinuation – Action Required

Summary:

Ankr has shut down their public Polygon RPC, which your app was likely using. This is what caused the error:

API key is not allowed to access blockchain, json-rpc code: -32052

:white_check_mark: Solution:

Web3Auth now abstracts this via Infura RPCs under the hood. To adopt the fix:

  1. Update SDK to v9.7.0 or higher
  2. Replace your existing chain config with the following snippet:
import { WEB3AUTH_NETWORK, getEvmChainConfig } from "@web3auth/base";
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";

const clientId = ""; // your Web3Auth client ID
const chainConfig = getEvmChainConfig(0xaa36a7, clientId)!;

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

:closed_lock_with_key: Reminder: Never rely on public RPCs in production — they can be rate-limited, deprecated, or removed without warning.

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