There seems to be some bug in the code. Please contact support to fix this. Also, this project is on sapphire_devnet network. Please ensure

  • SDK Version: web3auth-swift-sdk 8.4.0
  • Platform:
  • Browser Console Screenshots:
web3Auth = await Web3Auth(W3AInitParams(clientId: Constants.Strings.CLIENT_ID, network: .sapphire_mainnet, redirectUrl: Constants.Strings.REDIRECT_URL))

I have set the client ID of this project, the network is sapphire_mainnet but if I leave it like that in the sdk, it will report an error like that. But if I leave the network in the sdk as sapphire_devnet, it is fine. Please help me explain why it is like that?

Error
Something went wrong
There seems to be some bug in the code. Please contact support to fix this.
could not validate redirect, please whitelist your domain: com.holospace.fralee://auth for provided clientId My CLIENT ID at https://dashboard.web3auth.io. Also, this project is on sapphire_devnet network. Please ensure the the used Client ID belongs to this network.

Screenshot 2024-11-07 at 19.56.21 (1)

Hi Nguyễn Đức Hiếu!

Thank you for reaching out and providing the details regarding your issue with the PnP iOS SDK.

Here’s a summary of the information for our support team:

  • SDK Details: PnP iOS SDK
  • SDK Version: web3auth-swift-sdk 8.4.0
  • Network: sapphire_devnet (with issues when switching to sapphire_mainnet)
  • Error Message: “could not validate redirect, please whitelist your domain: com.holospace.fralee://auth for provided clientId [your CLIENT ID]”
  • Code Snippet:
    web3Auth = await Web3Auth(W3AInitParams(clientId: Constants.Strings.CLIENT_ID, network: .sapphire_mainnet, redirectUrl: Constants.Strings.REDIRECT_URL))
    
  • Screenshots Attached: Yes

Proposed Solution:

The error message suggests that you might need to whitelist your redirect URL for the specific client ID in your Web3Auth dashboard, particularly when switching to sapphire_mainnet. Each network has its own requirements for redirect URL validation, so ensure that your client ID is configured correctly for the intended network.

If you can provide the Web3Auth Initialization & Login Code Snippets and confirm if this issue relates to custom authentication with a specific provider, that would be helpful. But if the above details suffice, our support team will be able to assist you effectively!

Thank you for your patience, and let me know if there’s anything else I can help with!

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.

1 Like

But why am I using the client ID of a project with network sapphire_mainnet but getting an error message like this?

Also, this project is on sapphire_devnet network. Please ensure the the used Client ID belongs to this network.

facing same issue… will grow old before support team replies

1 Like

Can you please share the Web3Auth client id you are using in your project. Also, I see you are using older version of the SDK, please update the SDK to latest 9.0.0 version.

Hi, this is the client ID of the project I am using.

BMRpM3Ir3nUUtff40gZkKGYqkgE7R0PA-aXzdYUM-XjdTntF4WtCrhjH5YfoDysCCrsuSY4y-hE4SBGEkUdGzFs

I use this client ID on web SDK and it is fine. But on IOS SDK and Android SDK, I get the above error.

I used the latest sdk, both android and ios still have that error

You are right, I checked the project details, and it shows the project is created for the Sapphire Mainnet network. Can you share the Android and iOS SDK initialisation code, along with Web one?

Here is my code

  • Web: We do not develop on the web environment but also test with the web. I’m testing on the example code, replacing the client ID and network, and it works fine.
  • Android code
// Web3Auth config
        web3Auth = Web3Auth(
            Web3AuthOptions(
                context = this,
                clientId = CLIENT_ID,
                network = Network.SAPPHIRE_MAINNET,
                buildEnv = BuildEnv.PRODUCTION,
                redirectUrl = Uri.parse(redirectUrlWeb3Auth),
            )
        )
  • IOS code
web3Auth = await Web3Auth(W3AInitParams(clientId: Constants.Strings.CLIENT_ID, network: .sapphire_mainnet, redirectUrl: Constants.Strings.REDIRECT_URL))

From the code it looks fine, it should work fine. Is it possible for you to share the github repo for the project. If not, can you please join the office hours tomorrow so we can go through the code and debug it? Web3Auth Developer Office Hours